Last updated: 2023-08-07

Checks: 7 0

Knit directory: scSeq_Hefendehl/

This reproducible R Markdown analysis was created with workflowr (version 1.7.0). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.


Great! Since the R Markdown file has been committed to the Git repository, you know the exact version of the code that produced these results.

Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.

The command set.seed(20220131) was run prior to running the code in the R Markdown file. Setting a seed ensures that any results that rely on randomness, e.g. subsampling or permutations, are reproducible.

Great job! Recording the operating system, R version, and package versions is critical for reproducibility.

Nice! There were no cached chunks for this analysis, so you can be confident that you successfully produced the results during this run.

Great job! Using relative paths to the files within your workflowr project makes it easier to run your code on other machines.

Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility.

The results in this page were generated with repository version e103c55. See the Past versions tab to see a history of the changes made to the R Markdown and HTML files.

Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use wflow_publish or wflow_git_commit). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:


Ignored files:
    Ignored:    .RData
    Ignored:    .Rproj.user/
    Ignored:    analysis/figure/
    Ignored:    data/20230203/
    Ignored:    data/Alignments/
    Ignored:    data/Cluster.markers_02-02-2023.xlsx
    Ignored:    data/DAM_genelists.RData
    Ignored:    data/DEG_control_vs_stroke.xlsx
    Ignored:    data/ReloadAllData_Hefendehl_Stroke_Dec'21.RData
    Ignored:    data/Sample_Tables/
    Ignored:    data/Stroke-SS2_SCT-harmony_Hefendehl.html
    Ignored:    data/counts.csv
    Ignored:    data/genecounts.csv
    Ignored:    data/microglia-SCT_02-02-23.rds
    Ignored:    data/microglia_protein.rds
    Ignored:    data/samples.integrated.RData
    Ignored:    data/seu-SCT-harmony_02-02-23.rds
    Ignored:    data/seu_filtered_nonorm_02-02-23.rds
    Ignored:    data/tx2genes.csv
    Ignored:    output/CrossFCplot.pdf
    Ignored:    output/CrossFCplot.svg
    Ignored:    output/integrated_analysis.RData
    Ignored:    output/integrated_analysis.RDataTmp

Untracked files:
    Untracked:  shinySecret.R

Unstaged changes:
    Modified:   geneviewer/Dataset.RData
    Modified:   geneviewer/rsconnect/shinyapps.io/molgenlab/geneviewer.dcf
    Modified:   wflowhelper.R

Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.


These are the previous versions of the repository in which changes were made to the R Markdown (analysis/00.1_Original_Analysis_Integrated.Rmd) and HTML (docs/00.1_Original_Analysis_Integrated.html) files. If you’ve configured a remote Git repository (see ?wflow_git_remote), click on the hyperlinks in the table below to view the files as they were in that past version.

File Version Author Date Message
Rmd e103c55 Andreas Chiocchetti 2023-08-07 workflowr::wflow_publish(c("./docs/", "./analysis/", "./code/*",
html 6d3e973 Andreas Chiocchetti 2023-07-14 Build site.
Rmd d5c8125 Andreas Chiocchetti 2023-07-14 workflowr::wflow_publish(c("./docs/", "./analysis/", "./code/*",
html d5c8125 Andreas Chiocchetti 2023-07-14 workflowr::wflow_publish(c("./docs/", "./analysis/", "./code/*",
html 982b9f6 Andreas Chiocchetti 2023-02-20 Build site.
Rmd 438f7ad Andreas Chiocchetti 2023-02-20 workflowr::wflow_publish(c("./docs/", "./analysis/", "./code/*",
html 0e20f22 Andreas Chiocchetti 2023-02-16 Build site.
Rmd eaa373d Andreas Chiocchetti 2023-02-16 workflowr::wflow_publish(c("./docs/", "./analysis/", "./code/*",
html eaa373d Andreas Chiocchetti 2023-02-16 workflowr::wflow_publish(c("./docs/", "./analysis/", "./code/*",

Preprocessing

QC metrics from AG Hefendehl (Stroke)

Combined datasets and filter cells that have unique feature counts (gene number) over 7000 or less than 200 and cells with >5% mitochondrial counts.

# Visualize QC metrics as a violin plot
Idents(plates_hefendehl) <- "Plate"
VlnPlot(plates_hefendehl, features = c("nFeature_RNA", "nCount_RNA", "percent.mt","percent.rp"), 
        group.by = "Plate", ncol = 4)

Version Author Date
0e20f22 Andreas Chiocchetti 2023-02-16
eaa373d Andreas Chiocchetti 2023-02-16
SampleMeta=plates_hefendehl@meta.data
cormt<- cor(SampleMeta$nCount_RNA, SampleMeta$percent.mt, method="spearman")
corfeat<- cor(SampleMeta$nCount_RNA, SampleMeta$nFeature_RNA, method="spearman")

plot1 <- ggplot(plates_hefendehl@meta.data,aes(x=nCount_RNA, y=percent.mt, col=Plate))+
  geom_point()+theme_classic()+geom_abline(slope = 0, intercept = 5)+labs(title=cormt)
plot2 <- ggplot(plates_hefendehl@meta.data,aes(x=nCount_RNA, y=nFeature_RNA, col=Plate))+geom_point()+theme_classic()+geom_abline(slope = 0, intercept = 7000)+
  ggtitle(corfeat)

plot1 | plot2

Version Author Date
eaa373d Andreas Chiocchetti 2023-02-16

Perform integrated analysis

Version Author Date
eaa373d Andreas Chiocchetti 2023-02-16

Version Author Date
eaa373d Andreas Chiocchetti 2023-02-16

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20

PCA, tSNE and UMAP from the first 30 dimensions and with a resolution of 0.8

# Visualization

Idents(samples.integrated) <- "seurat_clusters"
DimPlot(samples.integrated, reduction = "umap", split.by = "Treatment")

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20
eaa373d Andreas Chiocchetti 2023-02-16
p1<- DimPlot(samples.integrated, reduction = "umap", group.by = "Plate")
p1a<- DimPlot(samples.integrated, reduction = "umap", group.by = "Mouse_ID")
p1b<- DimPlot(samples.integrated, reduction = "umap", group.by = "Genotype_Treatment")
  

p1 + p1a +  p1b

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20
0e20f22 Andreas Chiocchetti 2023-02-16
eaa373d Andreas Chiocchetti 2023-02-16
p1b<- DimPlot(samples.integrated, reduction = "umap", group.by = "Genotype_Treatment", 
              pt.size = 1)
p1b

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20
eaa373d Andreas Chiocchetti 2023-02-16
ggsave(file="./docs/UMAP_genotype_treatment.svg", p1b)
Saving 6 x 6 in image
ggsave(file="./docs/UMAP_genotype_treatment.pdf", p1b)
Saving 6 x 6 in image
p1b<- DimPlot(samples.integrated[,which(grepl("Micro",samples.integrated@meta.data$Celltype))], reduction = "umap", group.by = "Genotype_Treatment", pt.size=1)

p1b

ggsave(file="./docs/UMAP_only_Macroglia_genotype_treatment.svg", p1b)
Saving 6 x 6 in image
ggsave(file="./docs/UMAP_only_Macroglia_genotype_treatment.pdf", p1b)
Saving 6 x 6 in image
DimPlot(samples.integrated, group.by = "seurat_clusters", pt.size =1, label = T) + NoLegend()

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20
0e20f22 Andreas Chiocchetti 2023-02-16
eaa373d Andreas Chiocchetti 2023-02-16
DimPlot(samples.integrated, reduction = "umap", split.by = "Plate", pt.size= 1)

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20
0e20f22 Andreas Chiocchetti 2023-02-16
eaa373d Andreas Chiocchetti 2023-02-16
DimPlot(samples.integrated, reduction = "umap", split.by = "Genotype_Treatment", pt.size =1)

Cell cycle scoring

First, a score is assigned to each cell (Tirosh et al. 2016), based on its expression of G2/M and S phase markers. These markers should be anticorrelated in their expression levels and cells expression neither are likely not cycling and in G1 phase. Note: For downstream cell cylce regression the quantitative scores for G2/M and S phase are used, not the dicrete classification.

Version Author Date
d5c8125 Andreas Chiocchetti 2023-07-14

Version Author Date
d5c8125 Andreas Chiocchetti 2023-07-14

Cluster distribution

DimPlot(object = samples.integrated, pt.size = 1,reduction = "umap", group.by="Age",label = F) +
  ggtitle("Cluster distribution according to Age") + theme_classic()| DimPlot(object = samples.integrated, pt.size = 1,reduction = "umap", group.by="Genotype_Treatment",label = F) +
  ggtitle("Cluster distribution according to Genotype + Treatment")+ theme_classic()

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20
0e20f22 Andreas Chiocchetti 2023-02-16
eaa373d Andreas Chiocchetti 2023-02-16
DimPlot(object = samples.integrated, pt.size = 1,reduction = "umap", group.by="Plate",label = F) +
  ggtitle("Cluster distribution according to Plate")+ theme_classic() | DimPlot(object = samples.integrated, pt.size = 1,reduction = "umap", group.by = "seurat_clusters", label = T) +
  ggtitle("Clustering")+ theme_classic()

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20
0e20f22 Andreas Chiocchetti 2023-02-16
eaa373d Andreas Chiocchetti 2023-02-16
Idents(samples.integrated) <- "seurat_clusters"

# use same colors for clusters as in plots
require(scales)

samples.integrated$seurat_clusters = factor(samples.integrated$seurat_clusters, levels=sort(as.character(unique(samples.integrated$seurat_clusters))))
identities <- levels(samples.integrated$seurat_clusters) # Create vector with levels of object@ident
cluster_colors <- hue_pal()(length(identities)) # Create vector of default ggplot2 colors


# number of cells in each cluster 
cluster_nCell <- as.data.frame.matrix(table(samples.integrated$seurat_clusters,
                                            samples.integrated$Genotype_Treatment))
cluster_nCell["Total" ,] = colSums(cluster_nCell)
cluster_nCell
      APPPS1_Ctrl APPPS1_Stroke WT_Ctrl WT_Stroke
0             164            38     108        62
1              28            15      28        15
2              10             5      42         0
3               0             0       4         0
4               0             0       8         0
5               6             1       5         3
6               1             4       7         8
Total         209            63     202        88
# % of cells in each cluster , grouped by genotype_Age

cluster_per_Cell <- data.frame(table(samples.integrated$seurat_clusters, 
                              samples.integrated$Age))
colnames(cluster_per_Cell) <- c("Cluster", "Age", "Frequency")
cluster_per_Cell
   Cluster      Age Frequency
1        0 37 weeks       226
2        1 37 weeks        56
3        2 37 weeks        41
4        3 37 weeks         2
5        4 37 weeks         6
6        5 37 weeks         7
7        6 37 weeks        11
8        0 38 weeks        44
9        1 38 weeks         8
10       2 38 weeks        13
11       3 38 weeks         2
12       4 38 weeks         2
13       5 38 weeks         4
14       6 38 weeks         3
15       0 40 weeks       102
16       1 40 weeks        22
17       2 40 weeks         3
18       3 40 weeks         0
19       4 40 weeks         0
20       5 40 weeks         4
21       6 40 weeks         6
cluster_percent_Cell <- data.frame(round((prop.table(x = table(samples.integrated$seurat_clusters, 
                              samples.integrated$Age), margin = 2)*100),2))
colnames(cluster_percent_Cell) <- c("Cluster", "Age", "Frequency")
cluster_percent_Cell
   Cluster      Age Frequency
1        0 37 weeks     64.76
2        1 37 weeks     16.05
3        2 37 weeks     11.75
4        3 37 weeks      0.57
5        4 37 weeks      1.72
6        5 37 weeks      2.01
7        6 37 weeks      3.15
8        0 38 weeks     57.89
9        1 38 weeks     10.53
10       2 38 weeks     17.11
11       3 38 weeks      2.63
12       4 38 weeks      2.63
13       5 38 weeks      5.26
14       6 38 weeks      3.95
15       0 40 weeks     74.45
16       1 40 weeks     16.06
17       2 40 weeks      2.19
18       3 40 weeks      0.00
19       4 40 weeks      0.00
20       5 40 weeks      2.92
21       6 40 weeks      4.38
cluster_per_Treatment <- data.frame(table(samples.integrated$seurat_clusters, 
                              samples.integrated$Genotype_Treatment))
colnames(cluster_per_Treatment) <- c("Cluster", "Genotype_Treatment", "Frequency")
cluster_per_Treatment
   Cluster Genotype_Treatment Frequency
1        0        APPPS1_Ctrl       164
2        1        APPPS1_Ctrl        28
3        2        APPPS1_Ctrl        10
4        3        APPPS1_Ctrl         0
5        4        APPPS1_Ctrl         0
6        5        APPPS1_Ctrl         6
7        6        APPPS1_Ctrl         1
8        0      APPPS1_Stroke        38
9        1      APPPS1_Stroke        15
10       2      APPPS1_Stroke         5
11       3      APPPS1_Stroke         0
12       4      APPPS1_Stroke         0
13       5      APPPS1_Stroke         1
14       6      APPPS1_Stroke         4
15       0            WT_Ctrl       108
16       1            WT_Ctrl        28
17       2            WT_Ctrl        42
18       3            WT_Ctrl         4
19       4            WT_Ctrl         8
20       5            WT_Ctrl         5
21       6            WT_Ctrl         7
22       0          WT_Stroke        62
23       1          WT_Stroke        15
24       2          WT_Stroke         0
25       3          WT_Stroke         0
26       4          WT_Stroke         0
27       5          WT_Stroke         3
28       6          WT_Stroke         8
cluster_percent_Treatment <- data.frame(round((prop.table(x = table(samples.integrated$seurat_clusters, 
                              samples.integrated$Genotype_Treatment), margin = 2)*100),2))
colnames(cluster_percent_Treatment) <- c("Cluster", "Genotype_Treatment", "Frequency")
cluster_percent_Treatment
   Cluster Genotype_Treatment Frequency
1        0        APPPS1_Ctrl     78.47
2        1        APPPS1_Ctrl     13.40
3        2        APPPS1_Ctrl      4.78
4        3        APPPS1_Ctrl      0.00
5        4        APPPS1_Ctrl      0.00
6        5        APPPS1_Ctrl      2.87
7        6        APPPS1_Ctrl      0.48
8        0      APPPS1_Stroke     60.32
9        1      APPPS1_Stroke     23.81
10       2      APPPS1_Stroke      7.94
11       3      APPPS1_Stroke      0.00
12       4      APPPS1_Stroke      0.00
13       5      APPPS1_Stroke      1.59
14       6      APPPS1_Stroke      6.35
15       0            WT_Ctrl     53.47
16       1            WT_Ctrl     13.86
17       2            WT_Ctrl     20.79
18       3            WT_Ctrl      1.98
19       4            WT_Ctrl      3.96
20       5            WT_Ctrl      2.48
21       6            WT_Ctrl      3.47
22       0          WT_Stroke     70.45
23       1          WT_Stroke     17.05
24       2          WT_Stroke      0.00
25       3          WT_Stroke      0.00
26       4          WT_Stroke      0.00
27       5          WT_Stroke      3.41
28       6          WT_Stroke      9.09
# Grouped barchart of cell proportions
a1<- ggplot(cluster_percent_Cell, aes(fill=Age, 
                                 y=Frequency, 
                                 x=Cluster)) +
  geom_bar(position="dodge", stat="identity")+
  ggtitle("Cell distribution according to Age [%]") +theme_classic()+
  theme(axis.text.x = element_text(angle = 45, hjust=1, vjust=1)) +
  xlab("")


# Grouped barchart of cell proportions
b1 <- ggplot(cluster_percent_Cell, aes(fill=Cluster, y=Frequency, x=Age)) + 
  geom_bar(position="dodge", stat="identity")+
  ggtitle("Cell distribution according to Age [%]") +theme_classic()+
  theme(axis.text.x = element_text(angle = 45, hjust=1, vjust=1))


c1 <-ggplot(cluster_percent_Cell, aes(fill=Cluster, y=Frequency, x=Age)) + 
    geom_bar(position="stack", stat="identity")+theme_classic()+
  theme(axis.text.x = element_text(angle = 90, hjust=1, vjust=1))

a1 | b1 | c1

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20
0e20f22 Andreas Chiocchetti 2023-02-16
eaa373d Andreas Chiocchetti 2023-02-16
# Grouped barchart of cell proportions
a1<- ggplot(cluster_percent_Treatment, aes(fill=Genotype_Treatment, 
                                 y=Frequency, 
                                 x=Cluster)) +
  geom_bar(position="dodge", stat="identity")+
  ggtitle("Cell distribution according to Genotype_Treatment [%]") +theme_classic()+
  theme(axis.text.x = element_text(angle = 90, hjust=1, vjust=1)) +
  xlab("")


# Grouped barchart of cell proportions
b1 <- ggplot(cluster_percent_Treatment, aes(fill=Cluster, y=Frequency, x=Genotype_Treatment)) + 
  geom_bar(position="dodge", stat="identity")+
  ggtitle("Cell distribution according to Genotype_Treatment [%]") +theme_classic()+
  theme(axis.text.x = element_text(angle = 90, hjust=1, vjust=1))


c1 <-ggplot(cluster_percent_Treatment, aes(fill=Cluster, y=Frequency, x=Genotype_Treatment)) + 
    geom_bar(position="stack", stat="identity")+theme_classic()+
  theme(axis.text.x = element_text(angle = 90, hjust=1, vjust=1))

a1 | b1 | c1

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20
0e20f22 Andreas Chiocchetti 2023-02-16
eaa373d Andreas Chiocchetti 2023-02-16

Cell type identification

Finding differentially expressed features (cluster biomarkers)

Idents(samples.integrated) <- samples.integrated$seurat_clusters
samples.integrated=PrepSCTFindMarkers(samples.integrated)

markers <- FindAllMarkers(object = samples.integrated, 
                          only.pos = TRUE,
                          logfc.threshold = 0.25)  


DefaultAssay(samples.integrated) = "SCT"

markers %>%
    group_by(cluster) %>%
    top_n(n = 20, wt = avg_log2FC) -> top20

DoHeatmap(samples.integrated, features = top20$gene) + NoLegend() + ggtitle("Top20 cluster marker genes")

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20
0e20f22 Andreas Chiocchetti 2023-02-16
eaa373d Andreas Chiocchetti 2023-02-16

SingleR

SingleR is an automatic annotation method for (scRNAseq) data (Aran et al. 2019). Given a reference dataset of samples (single-cell or bulk) with known labels, it labels new cells from a test dataset based on similarity to the reference set. Here we use the built-in references “Immgen” (830 microarray samples of sorted hematopoetic and immune cell populations) and “Mouse RNA-Seq” (358 non-specific mouse RNA-seq samples).

Immgen reference

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20

MouseRNA-Seq reference Section Skipped as pred.mouseRNA object is not available

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20
# number of cells in each cluster 
cluster_nCell <- data.frame(table(samples.integrated$MouseRNASeq_sc_labels,samples.integrated$Genotype_Treatment))
colnames(cluster_nCell) <- c( "MouseRNASeq_sc_labels", "Genotype_Treatment","Number")

#cluster_nCell["Total" ,] = colSums(cluster_nCell)
# cluster_nCell

# % of cells in each cluster 
cluster_percent_Cell <- data.frame(round((prop.table(x = table(samples.integrated$MouseRNASeq_sc_labels, 
                              samples.integrated$Genotype_Treatment), margin = 2)*100),2))
colnames(cluster_percent_Cell) <- c("MouseRNASeq_sc_labels", "Genotype_Treatment", "Frequency")
# cluster_percent_Cell


# Grouped barchart of absolute cell numbers
ggplot(cluster_nCell, aes(fill=Genotype_Treatment, y=Number, x=MouseRNASeq_sc_labels)) + 
  geom_bar(position="dodge", stat="identity") +
  ggtitle("Cell distribution according to MouseRNASeq reference (absolut values)")+ theme_classic() +
  theme(axis.text.x = element_text(angle = 90, hjust=1, vjust=0.5)) +
  xlab("")

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20
0e20f22 Andreas Chiocchetti 2023-02-16
eaa373d Andreas Chiocchetti 2023-02-16
# Grouped barchart of cell proportions
ggplot(cluster_percent_Cell, aes(fill=Genotype_Treatment, y=Frequency, x=MouseRNASeq_sc_labels)) + 
  geom_bar(position="dodge", stat="identity")+
  ggtitle("Cell distribution according to MouseRNASeq reference [%]")+ theme_classic() +
  theme(axis.text.x = element_text(angle = 90, hjust=1, vjust=0.5)) +
  xlab("")

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20
0e20f22 Andreas Chiocchetti 2023-02-16
eaa373d Andreas Chiocchetti 2023-02-16
# number of cells in each cluster 
cluster_nCell <- data.frame(table(samples.integrated$Immgen_sc_labels,samples.integrated$Genotype_Treatment))
colnames(cluster_nCell) <- c( "Immgen_sc_labels", "Genotype_Treatment","Number")

#cluster_nCell["Total" ,] = colSums(cluster_nCell)
# cluster_nCell

# % of cells in each cluster 
cluster_percent_Cell <- data.frame(round((prop.table(x = table(samples.integrated$Immgen_sc_labels, 
                              samples.integrated$Genotype_Treatment), margin = 2)*100),2))
colnames(cluster_percent_Cell) <- c( "Immgen_sc_labels", "Genotype_Treatment","Frequency")
# cluster_percent_Cell


# Grouped barchart of absolute cell numbers
ggplot(cluster_nCell, aes(fill=Genotype_Treatment, y=Number, x=Immgen_sc_labels)) + 
  geom_bar(position="dodge", stat="identity") +
  ggtitle("Cell distribution according to Immgen reference (absolut values)") + theme_classic()+
  theme(axis.text.x = element_text(angle = 90, hjust=1, vjust=0.5)) +
  xlab("")

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20
0e20f22 Andreas Chiocchetti 2023-02-16
eaa373d Andreas Chiocchetti 2023-02-16
# Grouped barchart of cell proportions
ggplot(cluster_percent_Cell, aes(fill=Genotype_Treatment, y=Frequency, x=Immgen_sc_labels)) + 
  geom_bar(position="dodge", stat="identity")+
  ggtitle("Cell distribution according to Immgen reference [%]") + theme_classic()+
  theme(axis.text.x = element_text(angle = 90, hjust=1, vjust=0.5)) +
  xlab("")

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20
0e20f22 Andreas Chiocchetti 2023-02-16
eaa373d Andreas Chiocchetti 2023-02-16

Renaming Clusters

Idents(samples.integrated) = "Celltype"
DimPlot(samples.integrated, reduction = "umap", label=T) + NoLegend()+ theme_classic()

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20
0e20f22 Andreas Chiocchetti 2023-02-16
eaa373d Andreas Chiocchetti 2023-02-16
p1b<- DimPlot(samples.integrated, group.by = "Celltype", reduction="umap",
              pt.size =1, label = T)
p1b

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20
0e20f22 Andreas Chiocchetti 2023-02-16
eaa373d Andreas Chiocchetti 2023-02-16
ggsave(file="./docs/UMAP_Cluster.svg", p1b)
Saving 6 x 6 in image
ggsave(file="./docs/UMAP_Cluster.pdf", p1b)
Saving 6 x 6 in image
p1b<- DimPlot(samples.integrated[,which(grepl("Micro",samples.integrated@meta.data$Celltype))], 
              reduction = "umap", group.by = "Celltype",pt.size =1, label = T)
p1b

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20
0e20f22 Andreas Chiocchetti 2023-02-16
eaa373d Andreas Chiocchetti 2023-02-16
ggsave(file="./docs/UMAP_only_Macroglia_genotype_treatment.svg", p1b)
Saving 6 x 6 in image
ggsave(file="./docs/UMAP_only_Macroglia_genotype_treatment.pdf", p1b)
Saving 6 x 6 in image

Zoom into Microglia clusters

A second Seurat cluster is generated, where all non-microglial immune cells are removed according to the mouseRNASeq_sc_labels.

samples.microglia <- samples.integrated[,grepl("Microgli.*", samples.integrated$MouseRNASeq_sc_labels)]

p3 <- DimPlot(samples.microglia, reduction = "umap", label=T, group.by = "MouseRNASeq_sc_labels")  + theme_classic()+ NoLegend()

p3a <- DimPlot(samples.microglia, reduction = "umap", label=T, group.by = "seurat_clusters") + theme_classic()+ NoLegend()

p3 + p3a

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20
0e20f22 Andreas Chiocchetti 2023-02-16
eaa373d Andreas Chiocchetti 2023-02-16

DAMs (Cell. 2017 Jun 15;169(7):1276-1290.e17. doi: 10.1016/j.cell.2017.05.018)

DAM plotting

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20
0e20f22 Andreas Chiocchetti 2023-02-16
eaa373d Andreas Chiocchetti 2023-02-16
DAM2_marker_gene_list <- list(Stage2_DAM_up)
samples.microglia <- AddModuleScore(object = samples.microglia, 
                                    features = DAM2_marker_gene_list, name = "DAM2_score")
p5 <- FeaturePlot(object = samples.microglia, features = "DAM2_score1")+scale_color_viridis_c()
Scale for colour is already present.
Adding another scale for colour, which will replace the existing scale.
p5a <- DimPlot(object = samples.microglia, reduction = "umap")
DAM2cutoff = 2
phist = ggplot(data = samples.microglia@meta.data, aes(x=DAM2_score1))+
  geom_density()+geom_vline(xintercept = DAM2cutoff)+
  theme_classic()

samples.microglia$DAM2_binary = as.factor(samples.microglia$DAM2_score1>=DAM2cutoff)

pbin <- DimPlot(object = samples.microglia, group.by =  "DAM2_binary")

phist | p5 | pbin| p5a 

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20
0e20f22 Andreas Chiocchetti 2023-02-16
eaa373d Andreas Chiocchetti 2023-02-16

DAM 2 Markers

DAM2 upreagulated markers

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20

DAM2 dowreagulated markers

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20

## points of interest spatial sequencing

Special Seq plotting

Version Author Date
d5c8125 Andreas Chiocchetti 2023-07-14

Version Author Date
d5c8125 Andreas Chiocchetti 2023-07-14

**comparing DAM vs Spatial

it seems as if the cells identified with the spatial are in fact DAM cells (if a cell is a DAM1 cell there is a 110 fold-higher probability of also being a Stroke spatial or Control Spatial cell than not)

There are just 8 cells in total that are not DAM cells but Stroke/Control spatial cells

microgila_only=which(grepl("Microglia", samples.microglia@meta.data$Celltype))
a = table(DAM1=samples.microglia@meta.data$DAM1_binary[microgila_only], Stroke_spatial=samples.microglia@meta.data$Stroke_spatial_binary[microgila_only])

b = table(DAM2=samples.microglia@meta.data$DAM2_binary[microgila_only], Stroke_spatial=samples.microglia@meta.data$Stroke_spatial_binary[microgila_only])

c = table(DAM1=samples.microglia@meta.data$DAM1_binary[microgila_only], Control_spatial=samples.microglia@meta.data$Control_spatial_binary[microgila_only])

d= table(DAM2=samples.microglia@meta.data$DAM2_binary[microgila_only], Control_spatial=samples.microglia@meta.data$Control_spatial_binary[microgila_only])


e= table(Control_spatial=samples.microglia@meta.data$Control_spatial_binary[microgila_only], Stroke_spatial=samples.microglia@meta.data$Stroke_spatial_binary[microgila_only])


a
       Stroke_spatial
DAM1    FALSE TRUE
  FALSE   345   20
  TRUE     22  150
fisher.test(a)

    Fisher's Exact Test for Count Data

data:  a
p-value < 2.2e-16
alternative hypothesis: true odds ratio is not equal to 1
95 percent confidence interval:
  59.72689 234.67294
sample estimates:
odds ratio 
  114.9418 
b
       Stroke_spatial
DAM2    FALSE TRUE
  FALSE   309    8
  TRUE     58  162
fisher.test(b)

    Fisher's Exact Test for Count Data

data:  b
p-value < 2.2e-16
alternative hypothesis: true odds ratio is not equal to 1
95 percent confidence interval:
  49.27683 263.51616
sample estimates:
odds ratio 
  106.5147 
c
       Control_spatial
DAM1    FALSE TRUE
  FALSE   359    6
  TRUE    134   38
fisher.test(c)

    Fisher's Exact Test for Count Data

data:  c
p-value = 8.461e-15
alternative hypothesis: true odds ratio is not equal to 1
95 percent confidence interval:
  6.866547 49.997490
sample estimates:
odds ratio 
  16.86419 
d
       Control_spatial
DAM2    FALSE TRUE
  FALSE   311    6
  TRUE    182   38
fisher.test(d)

    Fisher's Exact Test for Count Data

data:  d
p-value = 1.429e-10
alternative hypothesis: true odds ratio is not equal to 1
95 percent confidence interval:
  4.40541 31.82585
sample estimates:
odds ratio 
  10.78139 
e
               Stroke_spatial
Control_spatial FALSE TRUE
          FALSE   359  134
          TRUE      8   36
fisher.test(e)

    Fisher's Exact Test for Count Data

data:  e
p-value = 9.942e-13
alternative hypothesis: true odds ratio is not equal to 1
95 percent confidence interval:
  5.309353 30.642655
sample estimates:
odds ratio 
  11.99238 

Renaming clusters

Idents(samples.microglia) <- "Celltype"
DimPlot(samples.microglia, reduction = "umap", label = TRUE, pt.size = 1)+ NoLegend()

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20
0e20f22 Andreas Chiocchetti 2023-02-16
eaa373d Andreas Chiocchetti 2023-02-16

Signature enrichment

All enrichment tests were done with gprofiler 2

Tested Ontologies and Signatures GO:MF = Molecular Function GO:BP = Biological Processes GO:CC = Cellular Compartment), KEGG = pathways from KEGG Reactome, TF = regulatory motif matches from TRANSFAC HPA = tissue specificity from Human Protein Atlas; CORUM = protein complexes from CORUM HP = human disease phenotypes from Human Phenotype Ontology.

For more dteails see Website: https://biit.cs.ut.ee/gprofiler/gost

DEGs and GSEA across microglia of different genotypes

log fold-change of the average expression between the two groups: Positive values indicate that the gene is more highly expressed in the target group (e.g. the APPPS1+ group)

WT vs App

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20

WT vs MX04+

log fold-chage of the average expression between the two groups: Positive values indicate that the gene is more highly expressed in the Methoxy positive group

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20

MX04+ vs MX04- in APPPS1 cohort only


  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |==================                                                    |  25%
  |                                                                            
  |===================================                                   |  50%
  |                                                                            
  |====================================================                  |  75%
  |                                                                            
  |======================================================================| 100%

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |==                                                                    |   2%
  |                                                                            
  |===                                                                   |   5%
  |                                                                            
  |=====                                                                 |   7%
  |                                                                            
  |=======                                                               |   9%
  |                                                                            
  |========                                                              |  12%
  |                                                                            
  |==========                                                            |  14%
  |                                                                            
  |===========                                                           |  16%
  |                                                                            
  |=============                                                         |  19%
  |                                                                            
  |===============                                                       |  21%
  |                                                                            
  |================                                                      |  23%
  |                                                                            
  |==================                                                    |  26%
  |                                                                            
  |====================                                                  |  28%
  |                                                                            
  |=====================                                                 |  30%
  |                                                                            
  |=======================                                               |  33%
  |                                                                            
  |========================                                              |  35%
  |                                                                            
  |==========================                                            |  37%
  |                                                                            
  |============================                                          |  40%
  |                                                                            
  |=============================                                         |  42%
  |                                                                            
  |===============================                                       |  44%
  |                                                                            
  |=================================                                     |  47%
  |                                                                            
  |==================================                                    |  49%
  |                                                                            
  |====================================                                  |  51%
  |                                                                            
  |=====================================                                 |  53%
  |                                                                            
  |=======================================                               |  56%
  |                                                                            
  |=========================================                             |  58%
  |                                                                            
  |==========================================                            |  60%
  |                                                                            
  |============================================                          |  63%
  |                                                                            
  |==============================================                        |  65%
  |                                                                            
  |===============================================                       |  67%
  |                                                                            
  |=================================================                     |  70%
  |                                                                            
  |==================================================                    |  72%
  |                                                                            
  |====================================================                  |  74%
  |                                                                            
  |======================================================                |  77%
  |                                                                            
  |=======================================================               |  79%
  |                                                                            
  |=========================================================             |  81%
  |                                                                            
  |===========================================================           |  84%
  |                                                                            
  |============================================================          |  86%
  |                                                                            
  |==============================================================        |  88%
  |                                                                            
  |===============================================================       |  91%
  |                                                                            
  |=================================================================     |  93%
  |                                                                            
  |===================================================================   |  95%
  |                                                                            
  |====================================================================  |  98%
  |                                                                            
  |======================================================================| 100%

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |==                                                                    |   2%
  |                                                                            
  |===                                                                   |   5%
  |                                                                            
  |=====                                                                 |   7%
  |                                                                            
  |=======                                                               |   9%
  |                                                                            
  |========                                                              |  12%
  |                                                                            
  |==========                                                            |  14%
  |                                                                            
  |===========                                                           |  16%
  |                                                                            
  |=============                                                         |  19%
  |                                                                            
  |===============                                                       |  21%
  |                                                                            
  |================                                                      |  23%
  |                                                                            
  |==================                                                    |  26%
  |                                                                            
  |====================                                                  |  28%
  |                                                                            
  |=====================                                                 |  30%
  |                                                                            
  |=======================                                               |  33%
  |                                                                            
  |========================                                              |  35%
  |                                                                            
  |==========================                                            |  37%
  |                                                                            
  |============================                                          |  40%
  |                                                                            
  |=============================                                         |  42%
  |                                                                            
  |===============================                                       |  44%
  |                                                                            
  |=================================                                     |  47%
  |                                                                            
  |==================================                                    |  49%
  |                                                                            
  |====================================                                  |  51%
  |                                                                            
  |=====================================                                 |  53%
  |                                                                            
  |=======================================                               |  56%
  |                                                                            
  |=========================================                             |  58%
  |                                                                            
  |==========================================                            |  60%
  |                                                                            
  |============================================                          |  63%
  |                                                                            
  |==============================================                        |  65%
  |                                                                            
  |===============================================                       |  67%
  |                                                                            
  |=================================================                     |  70%
  |                                                                            
  |==================================================                    |  72%
  |                                                                            
  |====================================================                  |  74%
  |                                                                            
  |======================================================                |  77%
  |                                                                            
  |=======================================================               |  79%
  |                                                                            
  |=========================================================             |  81%
  |                                                                            
  |===========================================================           |  84%
  |                                                                            
  |============================================================          |  86%
  |                                                                            
  |==============================================================        |  88%
  |                                                                            
  |===============================================================       |  91%
  |                                                                            
  |=================================================================     |  93%
  |                                                                            
  |===================================================================   |  95%
  |                                                                            
  |====================================================================  |  98%
  |                                                                            
  |======================================================================| 100%

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20

Stroke+ vs Stroke- in Control cohort only

positive FC indicate the gene is higher expressed in Stroke


  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |==================                                                    |  25%
  |                                                                            
  |===================================                                   |  50%
  |                                                                            
  |====================================================                  |  75%
  |                                                                            
  |======================================================================| 100%

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |=                                                                     |   2%
  |                                                                            
  |===                                                                   |   4%
  |                                                                            
  |====                                                                  |   6%
  |                                                                            
  |======                                                                |   8%
  |                                                                            
  |=======                                                               |  10%
  |                                                                            
  |=========                                                             |  12%
  |                                                                            
  |==========                                                            |  14%
  |                                                                            
  |===========                                                           |  16%
  |                                                                            
  |=============                                                         |  18%
  |                                                                            
  |==============                                                        |  20%
  |                                                                            
  |================                                                      |  22%
  |                                                                            
  |=================                                                     |  24%
  |                                                                            
  |===================                                                   |  27%
  |                                                                            
  |====================                                                  |  29%
  |                                                                            
  |=====================                                                 |  31%
  |                                                                            
  |=======================                                               |  33%
  |                                                                            
  |========================                                              |  35%
  |                                                                            
  |==========================                                            |  37%
  |                                                                            
  |===========================                                           |  39%
  |                                                                            
  |=============================                                         |  41%
  |                                                                            
  |==============================                                        |  43%
  |                                                                            
  |===============================                                       |  45%
  |                                                                            
  |=================================                                     |  47%
  |                                                                            
  |==================================                                    |  49%
  |                                                                            
  |====================================                                  |  51%
  |                                                                            
  |=====================================                                 |  53%
  |                                                                            
  |=======================================                               |  55%
  |                                                                            
  |========================================                              |  57%
  |                                                                            
  |=========================================                             |  59%
  |                                                                            
  |===========================================                           |  61%
  |                                                                            
  |============================================                          |  63%
  |                                                                            
  |==============================================                        |  65%
  |                                                                            
  |===============================================                       |  67%
  |                                                                            
  |=================================================                     |  69%
  |                                                                            
  |==================================================                    |  71%
  |                                                                            
  |===================================================                   |  73%
  |                                                                            
  |=====================================================                 |  76%
  |                                                                            
  |======================================================                |  78%
  |                                                                            
  |========================================================              |  80%
  |                                                                            
  |=========================================================             |  82%
  |                                                                            
  |===========================================================           |  84%
  |                                                                            
  |============================================================          |  86%
  |                                                                            
  |=============================================================         |  88%
  |                                                                            
  |===============================================================       |  90%
  |                                                                            
  |================================================================      |  92%
  |                                                                            
  |==================================================================    |  94%
  |                                                                            
  |===================================================================   |  96%
  |                                                                            
  |===================================================================== |  98%
  |                                                                            
  |======================================================================| 100%

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |=                                                                     |   2%
  |                                                                            
  |===                                                                   |   4%
  |                                                                            
  |====                                                                  |   6%
  |                                                                            
  |======                                                                |   8%
  |                                                                            
  |=======                                                               |  10%
  |                                                                            
  |=========                                                             |  12%
  |                                                                            
  |==========                                                            |  14%
  |                                                                            
  |===========                                                           |  16%
  |                                                                            
  |=============                                                         |  18%
  |                                                                            
  |==============                                                        |  20%
  |                                                                            
  |================                                                      |  22%
  |                                                                            
  |=================                                                     |  24%
  |                                                                            
  |===================                                                   |  27%
  |                                                                            
  |====================                                                  |  29%
  |                                                                            
  |=====================                                                 |  31%
  |                                                                            
  |=======================                                               |  33%
  |                                                                            
  |========================                                              |  35%
  |                                                                            
  |==========================                                            |  37%
  |                                                                            
  |===========================                                           |  39%
  |                                                                            
  |=============================                                         |  41%
  |                                                                            
  |==============================                                        |  43%
  |                                                                            
  |===============================                                       |  45%
  |                                                                            
  |=================================                                     |  47%
  |                                                                            
  |==================================                                    |  49%
  |                                                                            
  |====================================                                  |  51%
  |                                                                            
  |=====================================                                 |  53%
  |                                                                            
  |=======================================                               |  55%
  |                                                                            
  |========================================                              |  57%
  |                                                                            
  |=========================================                             |  59%
  |                                                                            
  |===========================================                           |  61%
  |                                                                            
  |============================================                          |  63%
  |                                                                            
  |==============================================                        |  65%
  |                                                                            
  |===============================================                       |  67%
  |                                                                            
  |=================================================                     |  69%
  |                                                                            
  |==================================================                    |  71%
  |                                                                            
  |===================================================                   |  73%
  |                                                                            
  |=====================================================                 |  76%
  |                                                                            
  |======================================================                |  78%
  |                                                                            
  |========================================================              |  80%
  |                                                                            
  |=========================================================             |  82%
  |                                                                            
  |===========================================================           |  84%
  |                                                                            
  |============================================================          |  86%
  |                                                                            
  |=============================================================         |  88%
  |                                                                            
  |===============================================================       |  90%
  |                                                                            
  |================================================================      |  92%
  |                                                                            
  |==================================================================    |  94%
  |                                                                            
  |===================================================================   |  96%
  |                                                                            
  |===================================================================== |  98%
  |                                                                            
  |======================================================================| 100%

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20

Stroke+ vs Stroke- in APPPS1 cohort only


  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |==================                                                    |  25%
  |                                                                            
  |===================================                                   |  50%
  |                                                                            
  |====================================================                  |  75%
  |                                                                            
  |======================================================================| 100%

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |==                                                                    |   2%
  |                                                                            
  |===                                                                   |   5%
  |                                                                            
  |=====                                                                 |   7%
  |                                                                            
  |=======                                                               |   9%
  |                                                                            
  |========                                                              |  12%
  |                                                                            
  |==========                                                            |  14%
  |                                                                            
  |===========                                                           |  16%
  |                                                                            
  |=============                                                         |  19%
  |                                                                            
  |===============                                                       |  21%
  |                                                                            
  |================                                                      |  23%
  |                                                                            
  |==================                                                    |  26%
  |                                                                            
  |====================                                                  |  28%
  |                                                                            
  |=====================                                                 |  30%
  |                                                                            
  |=======================                                               |  33%
  |                                                                            
  |========================                                              |  35%
  |                                                                            
  |==========================                                            |  37%
  |                                                                            
  |============================                                          |  40%
  |                                                                            
  |=============================                                         |  42%
  |                                                                            
  |===============================                                       |  44%
  |                                                                            
  |=================================                                     |  47%
  |                                                                            
  |==================================                                    |  49%
  |                                                                            
  |====================================                                  |  51%
  |                                                                            
  |=====================================                                 |  53%
  |                                                                            
  |=======================================                               |  56%
  |                                                                            
  |=========================================                             |  58%
  |                                                                            
  |==========================================                            |  60%
  |                                                                            
  |============================================                          |  63%
  |                                                                            
  |==============================================                        |  65%
  |                                                                            
  |===============================================                       |  67%
  |                                                                            
  |=================================================                     |  70%
  |                                                                            
  |==================================================                    |  72%
  |                                                                            
  |====================================================                  |  74%
  |                                                                            
  |======================================================                |  77%
  |                                                                            
  |=======================================================               |  79%
  |                                                                            
  |=========================================================             |  81%
  |                                                                            
  |===========================================================           |  84%
  |                                                                            
  |============================================================          |  86%
  |                                                                            
  |==============================================================        |  88%
  |                                                                            
  |===============================================================       |  91%
  |                                                                            
  |=================================================================     |  93%
  |                                                                            
  |===================================================================   |  95%
  |                                                                            
  |====================================================================  |  98%
  |                                                                            
  |======================================================================| 100%

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |==                                                                    |   2%
  |                                                                            
  |===                                                                   |   5%
  |                                                                            
  |=====                                                                 |   7%
  |                                                                            
  |=======                                                               |   9%
  |                                                                            
  |========                                                              |  12%
  |                                                                            
  |==========                                                            |  14%
  |                                                                            
  |===========                                                           |  16%
  |                                                                            
  |=============                                                         |  19%
  |                                                                            
  |===============                                                       |  21%
  |                                                                            
  |================                                                      |  23%
  |                                                                            
  |==================                                                    |  26%
  |                                                                            
  |====================                                                  |  28%
  |                                                                            
  |=====================                                                 |  30%
  |                                                                            
  |=======================                                               |  33%
  |                                                                            
  |========================                                              |  35%
  |                                                                            
  |==========================                                            |  37%
  |                                                                            
  |============================                                          |  40%
  |                                                                            
  |=============================                                         |  42%
  |                                                                            
  |===============================                                       |  44%
  |                                                                            
  |=================================                                     |  47%
  |                                                                            
  |==================================                                    |  49%
  |                                                                            
  |====================================                                  |  51%
  |                                                                            
  |=====================================                                 |  53%
  |                                                                            
  |=======================================                               |  56%
  |                                                                            
  |=========================================                             |  58%
  |                                                                            
  |==========================================                            |  60%
  |                                                                            
  |============================================                          |  63%
  |                                                                            
  |==============================================                        |  65%
  |                                                                            
  |===============================================                       |  67%
  |                                                                            
  |=================================================                     |  70%
  |                                                                            
  |==================================================                    |  72%
  |                                                                            
  |====================================================                  |  74%
  |                                                                            
  |======================================================                |  77%
  |                                                                            
  |=======================================================               |  79%
  |                                                                            
  |=========================================================             |  81%
  |                                                                            
  |===========================================================           |  84%
  |                                                                            
  |============================================================          |  86%
  |                                                                            
  |==============================================================        |  88%
  |                                                                            
  |===============================================================       |  91%
  |                                                                            
  |=================================================================     |  93%
  |                                                                            
  |===================================================================   |  95%
  |                                                                            
  |====================================================================  |  98%
  |                                                                            
  |======================================================================| 100%

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20
0e20f22 Andreas Chiocchetti 2023-02-16
eaa373d Andreas Chiocchetti 2023-02-16

**FC vs FC plots

overlapgenes=union(rownames(markers_Stroke_APP), rownames(markers_Stroke_CTRL))
dataset=data.frame(APP_log2FC = markers_Stroke_APP[overlapgenes,]$avg_log2FC, 
                       WT_log2FC = markers_Stroke_CTRL[overlapgenes,]$avg_log2FC)

isAPP<-abs(dataset$APP_log2FC)>0.58
isWT<-abs(dataset$WT_log2FC)>0.58

dataset$marker = "no-pref"
dataset$marker[which(isAPP)] = "APPS1+"
dataset$marker[which(isWT)] = "WT"
dataset$marker[which(isWT & isAPP)] = ifelse(abs(dataset$APP_log2FC[which(isWT & isAPP)])>
                                         abs(dataset$WT_log2FC[which(isWT & isAPP)]), 
                                       "APPS1+", "WT")

dataset$genes = overlapgenes
dataset$topgene = F


top5APP = order(abs(dataset$APP_log2FC), decreasing = T)[1:5]
top5WT = order(abs(dataset$WT_log2FC), decreasing = T)[1:5]

dataset$topgene[union(top5APP, top5WT)]=T


crossFC_plot = ggplot(data=dataset, 
       aes(x=APP_log2FC, y=WT_log2FC, color=marker))+
  geom_point()+theme_classic()+
  geom_abline(slope = 1, lty=2)+
  geom_abline(slope = -1, lty=2)+
  geom_text(data=subset(dataset, topgene), 
            aes(label=genes), show.legend = FALSE, nudge_y = -0.5)

crossFC_plot
Warning: Removed 3085 rows containing missing values (`geom_point()`).

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20
0e20f22 Andreas Chiocchetti 2023-02-16
eaa373d Andreas Chiocchetti 2023-02-16
ggsave(filename = "./output/CrossFCplot.svg", plot=crossFC_plot)
Saving 6 x 6 in image
Warning: Removed 3085 rows containing missing values (`geom_point()`).
ggsave(filename = "./output/CrossFCplot.pdf", plot=crossFC_plot)
Saving 6 x 6 in image
Warning: Removed 3085 rows containing missing values (`geom_point()`).

Stroke+ vs Stroke- in Stroke_binary_cells only

positive FC indicate the gene is higher expressed in Stroke


  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |==================                                                    |  25%
  |                                                                            
  |===================================                                   |  50%
  |                                                                            
  |====================================================                  |  75%
  |                                                                            
  |======================================================================| 100%

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |==                                                                    |   3%
  |                                                                            
  |====                                                                  |   5%
  |                                                                            
  |=====                                                                 |   8%
  |                                                                            
  |=======                                                               |  10%
  |                                                                            
  |=========                                                             |  13%
  |                                                                            
  |===========                                                           |  15%
  |                                                                            
  |=============                                                         |  18%
  |                                                                            
  |==============                                                        |  21%
  |                                                                            
  |================                                                      |  23%
  |                                                                            
  |==================                                                    |  26%
  |                                                                            
  |====================                                                  |  28%
  |                                                                            
  |======================                                                |  31%
  |                                                                            
  |=======================                                               |  33%
  |                                                                            
  |=========================                                             |  36%
  |                                                                            
  |===========================                                           |  38%
  |                                                                            
  |=============================                                         |  41%
  |                                                                            
  |===============================                                       |  44%
  |                                                                            
  |================================                                      |  46%
  |                                                                            
  |==================================                                    |  49%
  |                                                                            
  |====================================                                  |  51%
  |                                                                            
  |======================================                                |  54%
  |                                                                            
  |=======================================                               |  56%
  |                                                                            
  |=========================================                             |  59%
  |                                                                            
  |===========================================                           |  62%
  |                                                                            
  |=============================================                         |  64%
  |                                                                            
  |===============================================                       |  67%
  |                                                                            
  |================================================                      |  69%
  |                                                                            
  |==================================================                    |  72%
  |                                                                            
  |====================================================                  |  74%
  |                                                                            
  |======================================================                |  77%
  |                                                                            
  |========================================================              |  79%
  |                                                                            
  |=========================================================             |  82%
  |                                                                            
  |===========================================================           |  85%
  |                                                                            
  |=============================================================         |  87%
  |                                                                            
  |===============================================================       |  90%
  |                                                                            
  |=================================================================     |  92%
  |                                                                            
  |==================================================================    |  95%
  |                                                                            
  |====================================================================  |  97%
  |                                                                            
  |======================================================================| 100%

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |==                                                                    |   3%
  |                                                                            
  |====                                                                  |   5%
  |                                                                            
  |=====                                                                 |   8%
  |                                                                            
  |=======                                                               |  10%
  |                                                                            
  |=========                                                             |  13%
  |                                                                            
  |===========                                                           |  15%
  |                                                                            
  |=============                                                         |  18%
  |                                                                            
  |==============                                                        |  21%
  |                                                                            
  |================                                                      |  23%
  |                                                                            
  |==================                                                    |  26%
  |                                                                            
  |====================                                                  |  28%
  |                                                                            
  |======================                                                |  31%
  |                                                                            
  |=======================                                               |  33%
  |                                                                            
  |=========================                                             |  36%
  |                                                                            
  |===========================                                           |  38%
  |                                                                            
  |=============================                                         |  41%
  |                                                                            
  |===============================                                       |  44%
  |                                                                            
  |================================                                      |  46%
  |                                                                            
  |==================================                                    |  49%
  |                                                                            
  |====================================                                  |  51%
  |                                                                            
  |======================================                                |  54%
  |                                                                            
  |=======================================                               |  56%
  |                                                                            
  |=========================================                             |  59%
  |                                                                            
  |===========================================                           |  62%
  |                                                                            
  |=============================================                         |  64%
  |                                                                            
  |===============================================                       |  67%
  |                                                                            
  |================================================                      |  69%
  |                                                                            
  |==================================================                    |  72%
  |                                                                            
  |====================================================                  |  74%
  |                                                                            
  |======================================================                |  77%
  |                                                                            
  |========================================================              |  79%
  |                                                                            
  |=========================================================             |  82%
  |                                                                            
  |===========================================================           |  85%
  |                                                                            
  |=============================================================         |  87%
  |                                                                            
  |===============================================================       |  90%
  |                                                                            
  |=================================================================     |  92%
  |                                                                            
  |==================================================================    |  95%
  |                                                                            
  |====================================================================  |  97%
  |                                                                            
  |======================================================================| 100%

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20
0e20f22 Andreas Chiocchetti 2023-02-16
eaa373d Andreas Chiocchetti 2023-02-16

DEGs and GSEA of microglia of different genotype and treatment

WT_Ctrl vs WT_Stroke


  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |==================                                                    |  25%
  |                                                                            
  |===================================                                   |  50%
  |                                                                            
  |====================================================                  |  75%
  |                                                                            
  |======================================================================| 100%

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |=                                                                     |   2%
  |                                                                            
  |===                                                                   |   4%
  |                                                                            
  |====                                                                  |   6%
  |                                                                            
  |======                                                                |   8%
  |                                                                            
  |=======                                                               |  10%
  |                                                                            
  |=========                                                             |  12%
  |                                                                            
  |==========                                                            |  14%
  |                                                                            
  |===========                                                           |  16%
  |                                                                            
  |=============                                                         |  18%
  |                                                                            
  |==============                                                        |  20%
  |                                                                            
  |================                                                      |  22%
  |                                                                            
  |=================                                                     |  24%
  |                                                                            
  |===================                                                   |  27%
  |                                                                            
  |====================                                                  |  29%
  |                                                                            
  |=====================                                                 |  31%
  |                                                                            
  |=======================                                               |  33%
  |                                                                            
  |========================                                              |  35%
  |                                                                            
  |==========================                                            |  37%
  |                                                                            
  |===========================                                           |  39%
  |                                                                            
  |=============================                                         |  41%
  |                                                                            
  |==============================                                        |  43%
  |                                                                            
  |===============================                                       |  45%
  |                                                                            
  |=================================                                     |  47%
  |                                                                            
  |==================================                                    |  49%
  |                                                                            
  |====================================                                  |  51%
  |                                                                            
  |=====================================                                 |  53%
  |                                                                            
  |=======================================                               |  55%
  |                                                                            
  |========================================                              |  57%
  |                                                                            
  |=========================================                             |  59%
  |                                                                            
  |===========================================                           |  61%
  |                                                                            
  |============================================                          |  63%
  |                                                                            
  |==============================================                        |  65%
  |                                                                            
  |===============================================                       |  67%
  |                                                                            
  |=================================================                     |  69%
  |                                                                            
  |==================================================                    |  71%
  |                                                                            
  |===================================================                   |  73%
  |                                                                            
  |=====================================================                 |  76%
  |                                                                            
  |======================================================                |  78%
  |                                                                            
  |========================================================              |  80%
  |                                                                            
  |=========================================================             |  82%
  |                                                                            
  |===========================================================           |  84%
  |                                                                            
  |============================================================          |  86%
  |                                                                            
  |=============================================================         |  88%
  |                                                                            
  |===============================================================       |  90%
  |                                                                            
  |================================================================      |  92%
  |                                                                            
  |==================================================================    |  94%
  |                                                                            
  |===================================================================   |  96%
  |                                                                            
  |===================================================================== |  98%
  |                                                                            
  |======================================================================| 100%

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |=                                                                     |   2%
  |                                                                            
  |===                                                                   |   4%
  |                                                                            
  |====                                                                  |   6%
  |                                                                            
  |======                                                                |   8%
  |                                                                            
  |=======                                                               |  10%
  |                                                                            
  |=========                                                             |  12%
  |                                                                            
  |==========                                                            |  14%
  |                                                                            
  |===========                                                           |  16%
  |                                                                            
  |=============                                                         |  18%
  |                                                                            
  |==============                                                        |  20%
  |                                                                            
  |================                                                      |  22%
  |                                                                            
  |=================                                                     |  24%
  |                                                                            
  |===================                                                   |  27%
  |                                                                            
  |====================                                                  |  29%
  |                                                                            
  |=====================                                                 |  31%
  |                                                                            
  |=======================                                               |  33%
  |                                                                            
  |========================                                              |  35%
  |                                                                            
  |==========================                                            |  37%
  |                                                                            
  |===========================                                           |  39%
  |                                                                            
  |=============================                                         |  41%
  |                                                                            
  |==============================                                        |  43%
  |                                                                            
  |===============================                                       |  45%
  |                                                                            
  |=================================                                     |  47%
  |                                                                            
  |==================================                                    |  49%
  |                                                                            
  |====================================                                  |  51%
  |                                                                            
  |=====================================                                 |  53%
  |                                                                            
  |=======================================                               |  55%
  |                                                                            
  |========================================                              |  57%
  |                                                                            
  |=========================================                             |  59%
  |                                                                            
  |===========================================                           |  61%
  |                                                                            
  |============================================                          |  63%
  |                                                                            
  |==============================================                        |  65%
  |                                                                            
  |===============================================                       |  67%
  |                                                                            
  |=================================================                     |  69%
  |                                                                            
  |==================================================                    |  71%
  |                                                                            
  |===================================================                   |  73%
  |                                                                            
  |=====================================================                 |  76%
  |                                                                            
  |======================================================                |  78%
  |                                                                            
  |========================================================              |  80%
  |                                                                            
  |=========================================================             |  82%
  |                                                                            
  |===========================================================           |  84%
  |                                                                            
  |============================================================          |  86%
  |                                                                            
  |=============================================================         |  88%
  |                                                                            
  |===============================================================       |  90%
  |                                                                            
  |================================================================      |  92%
  |                                                                            
  |==================================================================    |  94%
  |                                                                            
  |===================================================================   |  96%
  |                                                                            
  |===================================================================== |  98%
  |                                                                            
  |======================================================================| 100%

Version Author Date
0e20f22 Andreas Chiocchetti 2023-02-16
eaa373d Andreas Chiocchetti 2023-02-16

APP_Ctrl vs APP_Stroke

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20
0e20f22 Andreas Chiocchetti 2023-02-16
eaa373d Andreas Chiocchetti 2023-02-16

WT_Ctrl vs APP_Ctrl


  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |==================                                                    |  25%
  |                                                                            
  |===================================                                   |  50%
  |                                                                            
  |====================================================                  |  75%
  |                                                                            
  |======================================================================| 100%

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |=                                                                     |   2%
  |                                                                            
  |===                                                                   |   4%
  |                                                                            
  |====                                                                  |   6%
  |                                                                            
  |=====                                                                 |   8%
  |                                                                            
  |=======                                                               |  10%
  |                                                                            
  |========                                                              |  12%
  |                                                                            
  |=========                                                             |  13%
  |                                                                            
  |===========                                                           |  15%
  |                                                                            
  |============                                                          |  17%
  |                                                                            
  |=============                                                         |  19%
  |                                                                            
  |===============                                                       |  21%
  |                                                                            
  |================                                                      |  23%
  |                                                                            
  |==================                                                    |  25%
  |                                                                            
  |===================                                                   |  27%
  |                                                                            
  |====================                                                  |  29%
  |                                                                            
  |======================                                                |  31%
  |                                                                            
  |=======================                                               |  33%
  |                                                                            
  |========================                                              |  35%
  |                                                                            
  |==========================                                            |  37%
  |                                                                            
  |===========================                                           |  38%
  |                                                                            
  |============================                                          |  40%
  |                                                                            
  |==============================                                        |  42%
  |                                                                            
  |===============================                                       |  44%
  |                                                                            
  |================================                                      |  46%
  |                                                                            
  |==================================                                    |  48%
  |                                                                            
  |===================================                                   |  50%
  |                                                                            
  |====================================                                  |  52%
  |                                                                            
  |======================================                                |  54%
  |                                                                            
  |=======================================                               |  56%
  |                                                                            
  |========================================                              |  58%
  |                                                                            
  |==========================================                            |  60%
  |                                                                            
  |===========================================                           |  62%
  |                                                                            
  |============================================                          |  63%
  |                                                                            
  |==============================================                        |  65%
  |                                                                            
  |===============================================                       |  67%
  |                                                                            
  |================================================                      |  69%
  |                                                                            
  |==================================================                    |  71%
  |                                                                            
  |===================================================                   |  73%
  |                                                                            
  |====================================================                  |  75%
  |                                                                            
  |======================================================                |  77%
  |                                                                            
  |=======================================================               |  79%
  |                                                                            
  |=========================================================             |  81%
  |                                                                            
  |==========================================================            |  83%
  |                                                                            
  |===========================================================           |  85%
  |                                                                            
  |=============================================================         |  87%
  |                                                                            
  |==============================================================        |  88%
  |                                                                            
  |===============================================================       |  90%
  |                                                                            
  |=================================================================     |  92%
  |                                                                            
  |==================================================================    |  94%
  |                                                                            
  |===================================================================   |  96%
  |                                                                            
  |===================================================================== |  98%
  |                                                                            
  |======================================================================| 100%

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |=                                                                     |   2%
  |                                                                            
  |===                                                                   |   4%
  |                                                                            
  |====                                                                  |   6%
  |                                                                            
  |=====                                                                 |   8%
  |                                                                            
  |=======                                                               |  10%
  |                                                                            
  |========                                                              |  12%
  |                                                                            
  |=========                                                             |  13%
  |                                                                            
  |===========                                                           |  15%
  |                                                                            
  |============                                                          |  17%
  |                                                                            
  |=============                                                         |  19%
  |                                                                            
  |===============                                                       |  21%
  |                                                                            
  |================                                                      |  23%
  |                                                                            
  |==================                                                    |  25%
  |                                                                            
  |===================                                                   |  27%
  |                                                                            
  |====================                                                  |  29%
  |                                                                            
  |======================                                                |  31%
  |                                                                            
  |=======================                                               |  33%
  |                                                                            
  |========================                                              |  35%
  |                                                                            
  |==========================                                            |  37%
  |                                                                            
  |===========================                                           |  38%
  |                                                                            
  |============================                                          |  40%
  |                                                                            
  |==============================                                        |  42%
  |                                                                            
  |===============================                                       |  44%
  |                                                                            
  |================================                                      |  46%
  |                                                                            
  |==================================                                    |  48%
  |                                                                            
  |===================================                                   |  50%
  |                                                                            
  |====================================                                  |  52%
  |                                                                            
  |======================================                                |  54%
  |                                                                            
  |=======================================                               |  56%
  |                                                                            
  |========================================                              |  58%
  |                                                                            
  |==========================================                            |  60%
  |                                                                            
  |===========================================                           |  62%
  |                                                                            
  |============================================                          |  63%
  |                                                                            
  |==============================================                        |  65%
  |                                                                            
  |===============================================                       |  67%
  |                                                                            
  |================================================                      |  69%
  |                                                                            
  |==================================================                    |  71%
  |                                                                            
  |===================================================                   |  73%
  |                                                                            
  |====================================================                  |  75%
  |                                                                            
  |======================================================                |  77%
  |                                                                            
  |=======================================================               |  79%
  |                                                                            
  |=========================================================             |  81%
  |                                                                            
  |==========================================================            |  83%
  |                                                                            
  |===========================================================           |  85%
  |                                                                            
  |=============================================================         |  87%
  |                                                                            
  |==============================================================        |  88%
  |                                                                            
  |===============================================================       |  90%
  |                                                                            
  |=================================================================     |  92%
  |                                                                            
  |==================================================================    |  94%
  |                                                                            
  |===================================================================   |  96%
  |                                                                            
  |===================================================================== |  98%
  |                                                                            
  |======================================================================| 100%

Version Author Date
d5c8125 Andreas Chiocchetti 2023-07-14

WT_Stroke vs APP_Stroke


  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |==================                                                    |  25%
  |                                                                            
  |===================================                                   |  50%
  |                                                                            
  |====================================================                  |  75%
  |                                                                            
  |======================================================================| 100%

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |==                                                                    |   3%
  |                                                                            
  |====                                                                  |   6%
  |                                                                            
  |======                                                                |   9%
  |                                                                            
  |========                                                              |  11%
  |                                                                            
  |==========                                                            |  14%
  |                                                                            
  |============                                                          |  17%
  |                                                                            
  |==============                                                        |  20%
  |                                                                            
  |================                                                      |  23%
  |                                                                            
  |==================                                                    |  26%
  |                                                                            
  |====================                                                  |  29%
  |                                                                            
  |======================                                                |  31%
  |                                                                            
  |========================                                              |  34%
  |                                                                            
  |==========================                                            |  37%
  |                                                                            
  |============================                                          |  40%
  |                                                                            
  |==============================                                        |  43%
  |                                                                            
  |================================                                      |  46%
  |                                                                            
  |==================================                                    |  49%
  |                                                                            
  |====================================                                  |  51%
  |                                                                            
  |======================================                                |  54%
  |                                                                            
  |========================================                              |  57%
  |                                                                            
  |==========================================                            |  60%
  |                                                                            
  |============================================                          |  63%
  |                                                                            
  |==============================================                        |  66%
  |                                                                            
  |================================================                      |  69%
  |                                                                            
  |==================================================                    |  71%
  |                                                                            
  |====================================================                  |  74%
  |                                                                            
  |======================================================                |  77%
  |                                                                            
  |========================================================              |  80%
  |                                                                            
  |==========================================================            |  83%
  |                                                                            
  |============================================================          |  86%
  |                                                                            
  |==============================================================        |  89%
  |                                                                            
  |================================================================      |  91%
  |                                                                            
  |==================================================================    |  94%
  |                                                                            
  |====================================================================  |  97%
  |                                                                            
  |======================================================================| 100%

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |==                                                                    |   3%
  |                                                                            
  |====                                                                  |   6%
  |                                                                            
  |======                                                                |   9%
  |                                                                            
  |========                                                              |  11%
  |                                                                            
  |==========                                                            |  14%
  |                                                                            
  |============                                                          |  17%
  |                                                                            
  |==============                                                        |  20%
  |                                                                            
  |================                                                      |  23%
  |                                                                            
  |==================                                                    |  26%
  |                                                                            
  |====================                                                  |  29%
  |                                                                            
  |======================                                                |  31%
  |                                                                            
  |========================                                              |  34%
  |                                                                            
  |==========================                                            |  37%
  |                                                                            
  |============================                                          |  40%
  |                                                                            
  |==============================                                        |  43%
  |                                                                            
  |================================                                      |  46%
  |                                                                            
  |==================================                                    |  49%
  |                                                                            
  |====================================                                  |  51%
  |                                                                            
  |======================================                                |  54%
  |                                                                            
  |========================================                              |  57%
  |                                                                            
  |==========================================                            |  60%
  |                                                                            
  |============================================                          |  63%
  |                                                                            
  |==============================================                        |  66%
  |                                                                            
  |================================================                      |  69%
  |                                                                            
  |==================================================                    |  71%
  |                                                                            
  |====================================================                  |  74%
  |                                                                            
  |======================================================                |  77%
  |                                                                            
  |========================================================              |  80%
  |                                                                            
  |==========================================================            |  83%
  |                                                                            
  |============================================================          |  86%
  |                                                                            
  |==============================================================        |  89%
  |                                                                            
  |================================================================      |  91%
  |                                                                            
  |==================================================================    |  94%
  |                                                                            
  |====================================================================  |  97%
  |                                                                            
  |======================================================================| 100%

Version Author Date
d5c8125 Andreas Chiocchetti 2023-07-14

DEGs and GSEA of each cluster

log fold-chage of the average expression between the two groups: Positive values indicate that the gene is more highly expressed in the target group (e.g. Microglia 0) versus all others.

Microglia_0

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20

Microglia_1

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20

Microglia_2

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20

Microglia_3

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20

Microglia_4

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20

Microglia_5

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20

Spatial Subgroup Controls

Version Author Date
d5c8125 Andreas Chiocchetti 2023-07-14

Version Author Date
d5c8125 Andreas Chiocchetti 2023-07-14

Genotype + Treatment comparison in each cluster

Idents(samples.microglia) <- "Genotype_Treatment"

mg1 <- samples.microglia[,samples.microglia$Celltype == "Microglia_1"]
mg1 <- SCTransform(mg1)
Calculating cell attributes from input UMI matrix: log_umi
Variance stabilizing transformation of count matrix of size 23747 by 371
Model formula is y ~ log_umi
Get Negative Binomial regression parameters per gene
Using 2000 genes, 371 cells

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |==================                                                    |  25%
  |                                                                            
  |===================================                                   |  50%
  |                                                                            
  |====================================================                  |  75%
  |                                                                            
  |======================================================================| 100%
There are 1 estimated thetas smaller than 1e-07 - will be set to 1e-07
Found 3 outliers - those will be ignored in fitting/regularization step
Second step: Get residuals using fitted parameters for 23747 genes

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |=                                                                     |   2%
  |                                                                            
  |===                                                                   |   4%
  |                                                                            
  |====                                                                  |   6%
  |                                                                            
  |======                                                                |   8%
  |                                                                            
  |=======                                                               |  10%
  |                                                                            
  |=========                                                             |  12%
  |                                                                            
  |==========                                                            |  15%
  |                                                                            
  |============                                                          |  17%
  |                                                                            
  |=============                                                         |  19%
  |                                                                            
  |===============                                                       |  21%
  |                                                                            
  |================                                                      |  23%
  |                                                                            
  |==================                                                    |  25%
  |                                                                            
  |===================                                                   |  27%
  |                                                                            
  |====================                                                  |  29%
  |                                                                            
  |======================                                                |  31%
  |                                                                            
  |=======================                                               |  33%
  |                                                                            
  |=========================                                             |  35%
  |                                                                            
  |==========================                                            |  38%
  |                                                                            
  |============================                                          |  40%
  |                                                                            
  |=============================                                         |  42%
  |                                                                            
  |===============================                                       |  44%
  |                                                                            
  |================================                                      |  46%
  |                                                                            
  |==================================                                    |  48%
  |                                                                            
  |===================================                                   |  50%
  |                                                                            
  |====================================                                  |  52%
  |                                                                            
  |======================================                                |  54%
  |                                                                            
  |=======================================                               |  56%
  |                                                                            
  |=========================================                             |  58%
  |                                                                            
  |==========================================                            |  60%
  |                                                                            
  |============================================                          |  62%
  |                                                                            
  |=============================================                         |  65%
  |                                                                            
  |===============================================                       |  67%
  |                                                                            
  |================================================                      |  69%
  |                                                                            
  |==================================================                    |  71%
  |                                                                            
  |===================================================                   |  73%
  |                                                                            
  |====================================================                  |  75%
  |                                                                            
  |======================================================                |  77%
  |                                                                            
  |=======================================================               |  79%
  |                                                                            
  |=========================================================             |  81%
  |                                                                            
  |==========================================================            |  83%
  |                                                                            
  |============================================================          |  85%
  |                                                                            
  |=============================================================         |  88%
  |                                                                            
  |===============================================================       |  90%
  |                                                                            
  |================================================================      |  92%
  |                                                                            
  |==================================================================    |  94%
  |                                                                            
  |===================================================================   |  96%
  |                                                                            
  |===================================================================== |  98%
  |                                                                            
  |======================================================================| 100%
Computing corrected count matrix for 23747 genes

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |=                                                                     |   2%
  |                                                                            
  |===                                                                   |   4%
  |                                                                            
  |====                                                                  |   6%
  |                                                                            
  |======                                                                |   8%
  |                                                                            
  |=======                                                               |  10%
  |                                                                            
  |=========                                                             |  12%
  |                                                                            
  |==========                                                            |  15%
  |                                                                            
  |============                                                          |  17%
  |                                                                            
  |=============                                                         |  19%
  |                                                                            
  |===============                                                       |  21%
  |                                                                            
  |================                                                      |  23%
  |                                                                            
  |==================                                                    |  25%
  |                                                                            
  |===================                                                   |  27%
  |                                                                            
  |====================                                                  |  29%
  |                                                                            
  |======================                                                |  31%
  |                                                                            
  |=======================                                               |  33%
  |                                                                            
  |=========================                                             |  35%
  |                                                                            
  |==========================                                            |  38%
  |                                                                            
  |============================                                          |  40%
  |                                                                            
  |=============================                                         |  42%
  |                                                                            
  |===============================                                       |  44%
  |                                                                            
  |================================                                      |  46%
  |                                                                            
  |==================================                                    |  48%
  |                                                                            
  |===================================                                   |  50%
  |                                                                            
  |====================================                                  |  52%
  |                                                                            
  |======================================                                |  54%
  |                                                                            
  |=======================================                               |  56%
  |                                                                            
  |=========================================                             |  58%
  |                                                                            
  |==========================================                            |  60%
  |                                                                            
  |============================================                          |  62%
  |                                                                            
  |=============================================                         |  65%
  |                                                                            
  |===============================================                       |  67%
  |                                                                            
  |================================================                      |  69%
  |                                                                            
  |==================================================                    |  71%
  |                                                                            
  |===================================================                   |  73%
  |                                                                            
  |====================================================                  |  75%
  |                                                                            
  |======================================================                |  77%
  |                                                                            
  |=======================================================               |  79%
  |                                                                            
  |=========================================================             |  81%
  |                                                                            
  |==========================================================            |  83%
  |                                                                            
  |============================================================          |  85%
  |                                                                            
  |=============================================================         |  88%
  |                                                                            
  |===============================================================       |  90%
  |                                                                            
  |================================================================      |  92%
  |                                                                            
  |==================================================================    |  94%
  |                                                                            
  |===================================================================   |  96%
  |                                                                            
  |===================================================================== |  98%
  |                                                                            
  |======================================================================| 100%
Calculating gene attributes
Wall clock passed: Time difference of 6.962585 secs
Determine variable features
Place corrected count matrix in counts slot
Centering data matrix
Set default assay to SCT
mg1.markers.Genotype_Treatment <- FindAllMarkers(mg1)
Calculating cluster WT_Stroke
Calculating cluster APPPS1_Ctrl
Calculating cluster APPPS1_Stroke
Calculating cluster WT_Ctrl
if(length(mg1.markers.Genotype_Treatment)!=0){
mg1_top20 = mg1.markers.Genotype_Treatment %>% group_by(cluster) %>% top_n(n=20, wt=abs(avg_log2FC))
mg1_top20chk=T
} else {mg1_top20chk=F}

mg2 <- samples.microglia[,samples.microglia$Celltype == "Microglia_2"]
mg2 <- SCTransform(mg2)
Calculating cell attributes from input UMI matrix: log_umi
Variance stabilizing transformation of count matrix of size 15372 by 86
Model formula is y ~ log_umi
Get Negative Binomial regression parameters per gene
Using 2000 genes, 86 cells

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |==================                                                    |  25%
  |                                                                            
  |===================================                                   |  50%
  |                                                                            
  |====================================================                  |  75%
  |                                                                            
  |======================================================================| 100%
There are 1 estimated thetas smaller than 1e-07 - will be set to 1e-07
Found 34 outliers - those will be ignored in fitting/regularization step
Second step: Get residuals using fitted parameters for 15372 genes

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |==                                                                    |   3%
  |                                                                            
  |=====                                                                 |   6%
  |                                                                            
  |=======                                                               |  10%
  |                                                                            
  |=========                                                             |  13%
  |                                                                            
  |===========                                                           |  16%
  |                                                                            
  |==============                                                        |  19%
  |                                                                            
  |================                                                      |  23%
  |                                                                            
  |==================                                                    |  26%
  |                                                                            
  |====================                                                  |  29%
  |                                                                            
  |=======================                                               |  32%
  |                                                                            
  |=========================                                             |  35%
  |                                                                            
  |===========================                                           |  39%
  |                                                                            
  |=============================                                         |  42%
  |                                                                            
  |================================                                      |  45%
  |                                                                            
  |==================================                                    |  48%
  |                                                                            
  |====================================                                  |  52%
  |                                                                            
  |======================================                                |  55%
  |                                                                            
  |=========================================                             |  58%
  |                                                                            
  |===========================================                           |  61%
  |                                                                            
  |=============================================                         |  65%
  |                                                                            
  |===============================================                       |  68%
  |                                                                            
  |==================================================                    |  71%
  |                                                                            
  |====================================================                  |  74%
  |                                                                            
  |======================================================                |  77%
  |                                                                            
  |========================================================              |  81%
  |                                                                            
  |===========================================================           |  84%
  |                                                                            
  |=============================================================         |  87%
  |                                                                            
  |===============================================================       |  90%
  |                                                                            
  |=================================================================     |  94%
  |                                                                            
  |====================================================================  |  97%
  |                                                                            
  |======================================================================| 100%
Computing corrected count matrix for 15372 genes

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |==                                                                    |   3%
  |                                                                            
  |=====                                                                 |   6%
  |                                                                            
  |=======                                                               |  10%
  |                                                                            
  |=========                                                             |  13%
  |                                                                            
  |===========                                                           |  16%
  |                                                                            
  |==============                                                        |  19%
  |                                                                            
  |================                                                      |  23%
  |                                                                            
  |==================                                                    |  26%
  |                                                                            
  |====================                                                  |  29%
  |                                                                            
  |=======================                                               |  32%
  |                                                                            
  |=========================                                             |  35%
  |                                                                            
  |===========================                                           |  39%
  |                                                                            
  |=============================                                         |  42%
  |                                                                            
  |================================                                      |  45%
  |                                                                            
  |==================================                                    |  48%
  |                                                                            
  |====================================                                  |  52%
  |                                                                            
  |======================================                                |  55%
  |                                                                            
  |=========================================                             |  58%
  |                                                                            
  |===========================================                           |  61%
  |                                                                            
  |=============================================                         |  65%
  |                                                                            
  |===============================================                       |  68%
  |                                                                            
  |==================================================                    |  71%
  |                                                                            
  |====================================================                  |  74%
  |                                                                            
  |======================================================                |  77%
  |                                                                            
  |========================================================              |  81%
  |                                                                            
  |===========================================================           |  84%
  |                                                                            
  |=============================================================         |  87%
  |                                                                            
  |===============================================================       |  90%
  |                                                                            
  |=================================================================     |  94%
  |                                                                            
  |====================================================================  |  97%
  |                                                                            
  |======================================================================| 100%
Calculating gene attributes
Wall clock passed: Time difference of 2.881491 secs
Determine variable features
Place corrected count matrix in counts slot
Centering data matrix
Set default assay to SCT
mg2.markers.Genotype_Treatment <- FindAllMarkers(mg2)
Calculating cluster WT_Stroke
Calculating cluster APPPS1_Ctrl
Calculating cluster APPPS1_Stroke
Calculating cluster WT_Ctrl
if(length(mg2.markers.Genotype_Treatment)!=0){
mg2_top20 = mg2.markers.Genotype_Treatment %>% group_by(cluster) %>% top_n(n=20, wt=abs(avg_log2FC))
mg2_top20chk=T
} else {mg2_top20chk=F}

mg3 <- samples.microglia[,samples.microglia$Celltype == "Microglia_3"]
mg3 <- SCTransform(mg3)
Calculating cell attributes from input UMI matrix: log_umi
Variance stabilizing transformation of count matrix of size 17416 by 57
Model formula is y ~ log_umi
Get Negative Binomial regression parameters per gene
Using 2000 genes, 57 cells

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |==================                                                    |  25%
  |                                                                            
  |===================================                                   |  50%
  |                                                                            
  |====================================================                  |  75%
  |                                                                            
  |======================================================================| 100%
There are 4 estimated thetas smaller than 1e-07 - will be set to 1e-07
Found 36 outliers - those will be ignored in fitting/regularization step
Second step: Get residuals using fitted parameters for 17416 genes

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |==                                                                    |   3%
  |                                                                            
  |====                                                                  |   6%
  |                                                                            
  |======                                                                |   9%
  |                                                                            
  |========                                                              |  11%
  |                                                                            
  |==========                                                            |  14%
  |                                                                            
  |============                                                          |  17%
  |                                                                            
  |==============                                                        |  20%
  |                                                                            
  |================                                                      |  23%
  |                                                                            
  |==================                                                    |  26%
  |                                                                            
  |====================                                                  |  29%
  |                                                                            
  |======================                                                |  31%
  |                                                                            
  |========================                                              |  34%
  |                                                                            
  |==========================                                            |  37%
  |                                                                            
  |============================                                          |  40%
  |                                                                            
  |==============================                                        |  43%
  |                                                                            
  |================================                                      |  46%
  |                                                                            
  |==================================                                    |  49%
  |                                                                            
  |====================================                                  |  51%
  |                                                                            
  |======================================                                |  54%
  |                                                                            
  |========================================                              |  57%
  |                                                                            
  |==========================================                            |  60%
  |                                                                            
  |============================================                          |  63%
  |                                                                            
  |==============================================                        |  66%
  |                                                                            
  |================================================                      |  69%
  |                                                                            
  |==================================================                    |  71%
  |                                                                            
  |====================================================                  |  74%
  |                                                                            
  |======================================================                |  77%
  |                                                                            
  |========================================================              |  80%
  |                                                                            
  |==========================================================            |  83%
  |                                                                            
  |============================================================          |  86%
  |                                                                            
  |==============================================================        |  89%
  |                                                                            
  |================================================================      |  91%
  |                                                                            
  |==================================================================    |  94%
  |                                                                            
  |====================================================================  |  97%
  |                                                                            
  |======================================================================| 100%
Computing corrected count matrix for 17416 genes

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |==                                                                    |   3%
  |                                                                            
  |====                                                                  |   6%
  |                                                                            
  |======                                                                |   9%
  |                                                                            
  |========                                                              |  11%
  |                                                                            
  |==========                                                            |  14%
  |                                                                            
  |============                                                          |  17%
  |                                                                            
  |==============                                                        |  20%
  |                                                                            
  |================                                                      |  23%
  |                                                                            
  |==================                                                    |  26%
  |                                                                            
  |====================                                                  |  29%
  |                                                                            
  |======================                                                |  31%
  |                                                                            
  |========================                                              |  34%
  |                                                                            
  |==========================                                            |  37%
  |                                                                            
  |============================                                          |  40%
  |                                                                            
  |==============================                                        |  43%
  |                                                                            
  |================================                                      |  46%
  |                                                                            
  |==================================                                    |  49%
  |                                                                            
  |====================================                                  |  51%
  |                                                                            
  |======================================                                |  54%
  |                                                                            
  |========================================                              |  57%
  |                                                                            
  |==========================================                            |  60%
  |                                                                            
  |============================================                          |  63%
  |                                                                            
  |==============================================                        |  66%
  |                                                                            
  |================================================                      |  69%
  |                                                                            
  |==================================================                    |  71%
  |                                                                            
  |====================================================                  |  74%
  |                                                                            
  |======================================================                |  77%
  |                                                                            
  |========================================================              |  80%
  |                                                                            
  |==========================================================            |  83%
  |                                                                            
  |============================================================          |  86%
  |                                                                            
  |==============================================================        |  89%
  |                                                                            
  |================================================================      |  91%
  |                                                                            
  |==================================================================    |  94%
  |                                                                            
  |====================================================================  |  97%
  |                                                                            
  |======================================================================| 100%
Calculating gene attributes
Wall clock passed: Time difference of 2.862536 secs
Determine variable features
Place corrected count matrix in counts slot
Centering data matrix
Set default assay to SCT
mg3.markers.Genotype_Treatment <- FindAllMarkers(mg3)
Calculating cluster APPPS1_Ctrl
Calculating cluster APPPS1_Stroke
Calculating cluster WT_Ctrl
if(length(mg3.markers.Genotype_Treatment)!=0){
mg3_top20 = mg3.markers.Genotype_Treatment %>% group_by(cluster) %>% top_n(n=20, wt=abs(avg_log2FC))
mg3_top20chk=T
} else {mg3_top20chk=F}

mg4 <- samples.microglia[,samples.microglia$Celltype == "Microglia_4"]
mg4 <- SCTransform(mg4)
Calculating cell attributes from input UMI matrix: log_umi
Variance stabilizing transformation of count matrix of size 2188 by 8
Model formula is y ~ log_umi
Get Negative Binomial regression parameters per gene
Using 2000 genes, 8 cells

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |==================                                                    |  25%
  |                                                                            
  |===================================                                   |  50%
  |                                                                            
  |====================================================                  |  75%
  |                                                                            
  |======================================================================| 100%
There are 25 estimated thetas smaller than 1e-07 - will be set to 1e-07
Found 47 outliers - those will be ignored in fitting/regularization step
Second step: Get residuals using fitted parameters for 2188 genes

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |==============                                                        |  20%
  |                                                                            
  |============================                                          |  40%
  |                                                                            
  |==========================================                            |  60%
  |                                                                            
  |========================================================              |  80%
  |                                                                            
  |======================================================================| 100%
Computing corrected count matrix for 2188 genes

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |==============                                                        |  20%
  |                                                                            
  |============================                                          |  40%
  |                                                                            
  |==========================================                            |  60%
  |                                                                            
  |========================================================              |  80%
  |                                                                            
  |======================================================================| 100%
Calculating gene attributes
Wall clock passed: Time difference of 1.328267 secs
Determine variable features
Place corrected count matrix in counts slot
Centering data matrix
Set default assay to SCT
mg4.markers.Genotype_Treatment <- FindAllMarkers(mg4)
Calculating cluster WT_Ctrl
Warning: No DE genes identified
Warning: The following tests were not performed:
Warning: When testing WT_Ctrl versus all:
    Cell group 2 is empty - no cells with identity class 
if(length(mg4.markers.Genotype_Treatment)!=0){
mg4_top20 = mg4.markers.Genotype_Treatment %>% group_by(cluster) %>% top_n(n=20, wt=abs(avg_log2FC))
mg4_top20chk=T
} else {mg4_top20chk=F}

mg5 <- samples.microglia[,samples.microglia$Celltype == "Microglia_5"]
mg5 <- SCTransform(mg5)
Calculating cell attributes from input UMI matrix: log_umi
Variance stabilizing transformation of count matrix of size 5172 by 15
Model formula is y ~ log_umi
Get Negative Binomial regression parameters per gene
Using 2000 genes, 15 cells

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |==================                                                    |  25%
  |                                                                            
  |===================================                                   |  50%
  |                                                                            
  |====================================================                  |  75%
  |                                                                            
  |======================================================================| 100%
Second step: Get residuals using fitted parameters for 5172 genes

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |======                                                                |   9%
  |                                                                            
  |=============                                                         |  18%
  |                                                                            
  |===================                                                   |  27%
  |                                                                            
  |=========================                                             |  36%
  |                                                                            
  |================================                                      |  45%
  |                                                                            
  |======================================                                |  55%
  |                                                                            
  |=============================================                         |  64%
  |                                                                            
  |===================================================                   |  73%
  |                                                                            
  |=========================================================             |  82%
  |                                                                            
  |================================================================      |  91%
  |                                                                            
  |======================================================================| 100%
Computing corrected count matrix for 5172 genes

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |======                                                                |   9%
  |                                                                            
  |=============                                                         |  18%
  |                                                                            
  |===================                                                   |  27%
  |                                                                            
  |=========================                                             |  36%
  |                                                                            
  |================================                                      |  45%
  |                                                                            
  |======================================                                |  55%
  |                                                                            
  |=============================================                         |  64%
  |                                                                            
  |===================================================                   |  73%
  |                                                                            
  |=========================================================             |  82%
  |                                                                            
  |================================================================      |  91%
  |                                                                            
  |======================================================================| 100%
Calculating gene attributes
Wall clock passed: Time difference of 1.555766 secs
Determine variable features
Place corrected count matrix in counts slot
Centering data matrix
Set default assay to SCT
mg5.markers.Genotype_Treatment <- FindAllMarkers(mg5)
Calculating cluster WT_Stroke
Calculating cluster APPPS1_Ctrl
Calculating cluster APPPS1_Stroke
Calculating cluster WT_Ctrl
Warning: The following tests were not performed:
Warning: When testing APPPS1_Stroke versus all:
    Cell group 1 has fewer than 3 cells
if(length(mg5.markers.Genotype_Treatment)!=0){
mg5_top20 = mg5.markers.Genotype_Treatment %>% group_by(cluster) %>% top_n(n=20, wt=abs(avg_log2FC))
mg5_top20chk=T
} else {mg5_top20chk=F}

sp_ctrl <- samples.microglia[,samples.microglia$Control_spatial_binary==T]
sp_ctrl <- SCTransform(sp_ctrl)
Calculating cell attributes from input UMI matrix: log_umi
Variance stabilizing transformation of count matrix of size 11668 by 44
Model formula is y ~ log_umi
Get Negative Binomial regression parameters per gene
Using 2000 genes, 44 cells

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |==================                                                    |  25%
  |                                                                            
  |===================================                                   |  50%
  |                                                                            
  |====================================================                  |  75%
  |                                                                            
  |======================================================================| 100%
There are 1 estimated thetas smaller than 1e-07 - will be set to 1e-07
Found 2 outliers - those will be ignored in fitting/regularization step
Second step: Get residuals using fitted parameters for 11668 genes

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |===                                                                   |   4%
  |                                                                            
  |======                                                                |   8%
  |                                                                            
  |=========                                                             |  12%
  |                                                                            
  |============                                                          |  17%
  |                                                                            
  |===============                                                       |  21%
  |                                                                            
  |==================                                                    |  25%
  |                                                                            
  |====================                                                  |  29%
  |                                                                            
  |=======================                                               |  33%
  |                                                                            
  |==========================                                            |  38%
  |                                                                            
  |=============================                                         |  42%
  |                                                                            
  |================================                                      |  46%
  |                                                                            
  |===================================                                   |  50%
  |                                                                            
  |======================================                                |  54%
  |                                                                            
  |=========================================                             |  58%
  |                                                                            
  |============================================                          |  62%
  |                                                                            
  |===============================================                       |  67%
  |                                                                            
  |==================================================                    |  71%
  |                                                                            
  |====================================================                  |  75%
  |                                                                            
  |=======================================================               |  79%
  |                                                                            
  |==========================================================            |  83%
  |                                                                            
  |=============================================================         |  88%
  |                                                                            
  |================================================================      |  92%
  |                                                                            
  |===================================================================   |  96%
  |                                                                            
  |======================================================================| 100%
Computing corrected count matrix for 11668 genes

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |===                                                                   |   4%
  |                                                                            
  |======                                                                |   8%
  |                                                                            
  |=========                                                             |  12%
  |                                                                            
  |============                                                          |  17%
  |                                                                            
  |===============                                                       |  21%
  |                                                                            
  |==================                                                    |  25%
  |                                                                            
  |====================                                                  |  29%
  |                                                                            
  |=======================                                               |  33%
  |                                                                            
  |==========================                                            |  38%
  |                                                                            
  |=============================                                         |  42%
  |                                                                            
  |================================                                      |  46%
  |                                                                            
  |===================================                                   |  50%
  |                                                                            
  |======================================                                |  54%
  |                                                                            
  |=========================================                             |  58%
  |                                                                            
  |============================================                          |  62%
  |                                                                            
  |===============================================                       |  67%
  |                                                                            
  |==================================================                    |  71%
  |                                                                            
  |====================================================                  |  75%
  |                                                                            
  |=======================================================               |  79%
  |                                                                            
  |==========================================================            |  83%
  |                                                                            
  |=============================================================         |  88%
  |                                                                            
  |================================================================      |  92%
  |                                                                            
  |===================================================================   |  96%
  |                                                                            
  |======================================================================| 100%
Calculating gene attributes
Wall clock passed: Time difference of 2.196464 secs
Determine variable features
Place corrected count matrix in counts slot
Centering data matrix
Set default assay to SCT
sp_ctrl.markers.Genotype_Treatment <- FindAllMarkers(sp_ctrl)
Calculating cluster WT_Stroke
Calculating cluster APPPS1_Ctrl
Calculating cluster APPPS1_Stroke
Calculating cluster WT_Ctrl
if(length(sp_ctrl.markers.Genotype_Treatment)!=0){
sp_ctrl_top20 = sp_ctrl.markers.Genotype_Treatment %>% group_by(cluster) %>% top_n(n=20, wt=abs(avg_log2FC))
sp_ctrl_top20chk=T
} else {sp_ctrl_top20chk=F}

sp_stroke <- samples.microglia[,samples.microglia$Stroke_spatial_binary==T]
sp_stroke <- SCTransform(sp_stroke)
Calculating cell attributes from input UMI matrix: log_umi
Variance stabilizing transformation of count matrix of size 19085 by 170
Model formula is y ~ log_umi
Get Negative Binomial regression parameters per gene
Using 2000 genes, 170 cells

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |==================                                                    |  25%
  |                                                                            
  |===================================                                   |  50%
  |                                                                            
  |====================================================                  |  75%
  |                                                                            
  |======================================================================| 100%
There are 1 estimated thetas smaller than 1e-07 - will be set to 1e-07
Found 3 outliers - those will be ignored in fitting/regularization step
Second step: Get residuals using fitted parameters for 19085 genes

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |==                                                                    |   3%
  |                                                                            
  |====                                                                  |   5%
  |                                                                            
  |=====                                                                 |   8%
  |                                                                            
  |=======                                                               |  10%
  |                                                                            
  |=========                                                             |  13%
  |                                                                            
  |===========                                                           |  15%
  |                                                                            
  |=============                                                         |  18%
  |                                                                            
  |==============                                                        |  21%
  |                                                                            
  |================                                                      |  23%
  |                                                                            
  |==================                                                    |  26%
  |                                                                            
  |====================                                                  |  28%
  |                                                                            
  |======================                                                |  31%
  |                                                                            
  |=======================                                               |  33%
  |                                                                            
  |=========================                                             |  36%
  |                                                                            
  |===========================                                           |  38%
  |                                                                            
  |=============================                                         |  41%
  |                                                                            
  |===============================                                       |  44%
  |                                                                            
  |================================                                      |  46%
  |                                                                            
  |==================================                                    |  49%
  |                                                                            
  |====================================                                  |  51%
  |                                                                            
  |======================================                                |  54%
  |                                                                            
  |=======================================                               |  56%
  |                                                                            
  |=========================================                             |  59%
  |                                                                            
  |===========================================                           |  62%
  |                                                                            
  |=============================================                         |  64%
  |                                                                            
  |===============================================                       |  67%
  |                                                                            
  |================================================                      |  69%
  |                                                                            
  |==================================================                    |  72%
  |                                                                            
  |====================================================                  |  74%
  |                                                                            
  |======================================================                |  77%
  |                                                                            
  |========================================================              |  79%
  |                                                                            
  |=========================================================             |  82%
  |                                                                            
  |===========================================================           |  85%
  |                                                                            
  |=============================================================         |  87%
  |                                                                            
  |===============================================================       |  90%
  |                                                                            
  |=================================================================     |  92%
  |                                                                            
  |==================================================================    |  95%
  |                                                                            
  |====================================================================  |  97%
  |                                                                            
  |======================================================================| 100%
Computing corrected count matrix for 19085 genes

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |==                                                                    |   3%
  |                                                                            
  |====                                                                  |   5%
  |                                                                            
  |=====                                                                 |   8%
  |                                                                            
  |=======                                                               |  10%
  |                                                                            
  |=========                                                             |  13%
  |                                                                            
  |===========                                                           |  15%
  |                                                                            
  |=============                                                         |  18%
  |                                                                            
  |==============                                                        |  21%
  |                                                                            
  |================                                                      |  23%
  |                                                                            
  |==================                                                    |  26%
  |                                                                            
  |====================                                                  |  28%
  |                                                                            
  |======================                                                |  31%
  |                                                                            
  |=======================                                               |  33%
  |                                                                            
  |=========================                                             |  36%
  |                                                                            
  |===========================                                           |  38%
  |                                                                            
  |=============================                                         |  41%
  |                                                                            
  |===============================                                       |  44%
  |                                                                            
  |================================                                      |  46%
  |                                                                            
  |==================================                                    |  49%
  |                                                                            
  |====================================                                  |  51%
  |                                                                            
  |======================================                                |  54%
  |                                                                            
  |=======================================                               |  56%
  |                                                                            
  |=========================================                             |  59%
  |                                                                            
  |===========================================                           |  62%
  |                                                                            
  |=============================================                         |  64%
  |                                                                            
  |===============================================                       |  67%
  |                                                                            
  |================================================                      |  69%
  |                                                                            
  |==================================================                    |  72%
  |                                                                            
  |====================================================                  |  74%
  |                                                                            
  |======================================================                |  77%
  |                                                                            
  |========================================================              |  79%
  |                                                                            
  |=========================================================             |  82%
  |                                                                            
  |===========================================================           |  85%
  |                                                                            
  |=============================================================         |  87%
  |                                                                            
  |===============================================================       |  90%
  |                                                                            
  |=================================================================     |  92%
  |                                                                            
  |==================================================================    |  95%
  |                                                                            
  |====================================================================  |  97%
  |                                                                            
  |======================================================================| 100%
Calculating gene attributes
Wall clock passed: Time difference of 3.882366 secs
Determine variable features
Place corrected count matrix in counts slot
Centering data matrix
Set default assay to SCT
sp_stroke.markers.Genotype_Treatment <- FindAllMarkers(sp_stroke)
Calculating cluster WT_Stroke
Calculating cluster APPPS1_Ctrl
Calculating cluster APPPS1_Stroke
Calculating cluster WT_Ctrl
Warning: The following tests were not performed:
Warning: When testing WT_Ctrl versus all:
    Cell group 1 has fewer than 3 cells
if(length(sp_stroke.markers.Genotype_Treatment)!=0){
sp_stroke_top20 = sp_stroke.markers.Genotype_Treatment %>% group_by(cluster) %>% top_n(n=20, wt=abs(avg_log2FC))
sp_stroke_top20chk=T
} else {sp_stroke_top20chk=F}

Microglia_1

Microglia_2

Microglia_3

Microglia_4

[1] "no significant markers identified"

Microglia_5

spatial Controls

spatial Stroke

save.image("./output/integrated_analysis.RData")

sessionInfo()
R version 4.2.2 (2022-10-31)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 22.04.1 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.10.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.10.0

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats4    stats     graphics  grDevices utils     datasets  methods  
[8] base     

other attached packages:
 [1] DESeq2_1.38.3               scales_1.2.1               
 [3] gprofiler2_0.2.1            forcats_1.0.0              
 [5] stringr_1.5.0               dplyr_1.1.0                
 [7] purrr_1.0.1                 readr_2.1.4                
 [9] tidyr_1.3.0                 tibble_3.1.8               
[11] tidyverse_1.3.2             pheatmap_1.0.12            
[13] EnhancedVolcano_1.16.0      ggrepel_0.9.3              
[15] SingleR_2.0.0               SummarizedExperiment_1.28.0
[17] Biobase_2.58.0              GenomicRanges_1.50.2       
[19] GenomeInfoDb_1.34.9         IRanges_2.32.0             
[21] S4Vectors_0.36.1            BiocGenerics_0.44.0        
[23] MatrixGenerics_1.10.0       matrixStats_0.63.0         
[25] ggplot2_3.4.1               SeuratObject_4.1.3         
[27] Seurat_4.3.0                workflowr_1.7.0            

loaded via a namespace (and not attached):
  [1] scattermore_0.8           ragg_1.2.5               
  [3] bit64_4.0.5               knitr_1.42               
  [5] irlba_2.3.5.1             DelayedArray_0.24.0      
  [7] data.table_1.14.6         KEGGREST_1.38.0          
  [9] RCurl_1.98-1.10           generics_0.1.3           
 [11] ScaledMatrix_1.6.0        callr_3.7.3              
 [13] cowplot_1.1.1             RSQLite_2.2.20           
 [15] RANN_2.6.1                future_1.31.0            
 [17] bit_4.0.5                 tzdb_0.3.0               
 [19] spatstat.data_3.0-0       xml2_1.3.3               
 [21] lubridate_1.9.2           httpuv_1.6.9             
 [23] assertthat_0.2.1          gargle_1.3.0             
 [25] xfun_0.37                 hms_1.1.2                
 [27] jquerylib_0.1.4           evaluate_0.20            
 [29] promises_1.2.0.1          fansi_1.0.4              
 [31] dbplyr_2.3.0              readxl_1.4.2             
 [33] igraph_1.4.0              DBI_1.1.3                
 [35] geneplotter_1.76.0        htmlwidgets_1.6.1        
 [37] spatstat.geom_3.0-6       googledrive_2.0.0        
 [39] ellipsis_0.3.2            crosstalk_1.2.0          
 [41] backports_1.4.1           annotate_1.76.0          
 [43] deldir_1.0-6              sparseMatrixStats_1.10.0 
 [45] vctrs_0.5.2               ROCR_1.0-11              
 [47] abind_1.4-5               cachem_1.0.6             
 [49] withr_2.5.0               progressr_0.13.0         
 [51] sctransform_0.3.5         goftest_1.2-3            
 [53] svglite_2.1.1             cluster_2.1.4            
 [55] lazyeval_0.2.2            crayon_1.5.2             
 [57] spatstat.explore_3.0-6    pkgconfig_2.0.3          
 [59] labeling_0.4.2            nlme_3.1-162             
 [61] vipor_0.4.5               rlang_1.0.6              
 [63] globals_0.16.2            lifecycle_1.0.3          
 [65] miniUI_0.1.1.1            modelr_0.1.10            
 [67] rsvd_1.0.5                ggrastr_1.0.1            
 [69] cellranger_1.1.0          rprojroot_2.0.3          
 [71] polyclip_1.10-4           lmtest_0.9-40            
 [73] Matrix_1.5-3              zoo_1.8-11               
 [75] reprex_2.0.2              beeswarm_0.4.0           
 [77] whisker_0.4.1             ggridges_0.5.4           
 [79] processx_3.8.0            googlesheets4_1.0.1      
 [81] png_0.1-8                 viridisLite_0.4.1        
 [83] bitops_1.0-7              getPass_0.2-2            
 [85] KernSmooth_2.23-20        Biostrings_2.66.0        
 [87] blob_1.2.3                DelayedMatrixStats_1.20.0
 [89] parallelly_1.34.0         spatstat.random_3.1-3    
 [91] beachmat_2.14.0           memoise_2.0.1            
 [93] magrittr_2.0.3            plyr_1.8.8               
 [95] ica_1.0-3                 zlibbioc_1.44.0          
 [97] compiler_4.2.2            RColorBrewer_1.1-3       
 [99] fitdistrplus_1.1-8        cli_3.6.0                
[101] XVector_0.38.0            listenv_0.9.0            
[103] patchwork_1.1.2           pbapply_1.7-0            
[105] ps_1.7.2                  MASS_7.3-58.2            
[107] tidyselect_1.2.0          stringi_1.7.12           
[109] textshaping_0.3.6         highr_0.10               
[111] yaml_2.3.7                locfit_1.5-9.7           
[113] BiocSingular_1.14.0       grid_4.2.2               
[115] sass_0.4.5                tools_4.2.2              
[117] timechange_0.2.0          future.apply_1.10.0      
[119] parallel_4.2.2            rstudioapi_0.14          
[121] git2r_0.31.0              gridExtra_2.3            
[123] farver_2.1.1              Rtsne_0.16               
[125] digest_0.6.31             shiny_1.7.4              
[127] Rcpp_1.0.10               broom_1.0.3              
[129] later_1.3.0               RcppAnnoy_0.0.20         
[131] httr_1.4.4                AnnotationDbi_1.60.0     
[133] colorspace_2.1-0          rvest_1.0.3              
[135] XML_3.99-0.13             fs_1.6.1                 
[137] tensor_1.5                reticulate_1.28          
[139] splines_4.2.2             uwot_0.1.14              
[141] spatstat.utils_3.0-1      sp_1.6-0                 
[143] plotly_4.10.1             systemfonts_1.0.4        
[145] xtable_1.8-4              jsonlite_1.8.4           
[147] R6_2.5.1                  pillar_1.8.1             
[149] htmltools_0.5.4           mime_0.12                
[151] DT_0.27                   glue_1.6.2               
[153] fastmap_1.1.0             BiocParallel_1.32.5      
[155] codetools_0.2-19          utf8_1.2.3               
[157] lattice_0.20-45           bslib_0.4.2              
[159] spatstat.sparse_3.0-0     ggbeeswarm_0.7.1         
[161] leiden_0.4.3              zip_2.2.2                
[163] openxlsx_4.2.5.2          survival_3.5-3           
[165] limma_3.54.1              rmarkdown_2.20           
[167] munsell_0.5.0             GenomeInfoDbData_1.2.9   
[169] haven_2.5.1               reshape2_1.4.4           
[171] gtable_0.3.1